# Example for custom action / docker-compose not working

**URL:** <https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165>\
**Category:** Rasa Open Source\
**Created:** [November 12, 2019, 5:23pm UTC](https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165 "2019-11-12T17:23:15Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ideivitcom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ideivitcom/32/5640_2.png) [@ideivitcom](https://forum.rasa.com/u/ideivitcom)\
**Post date:** [November 12, 2019, 5:23pm UTC](https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165/1 "2019-11-12T17:23:16Z")

</div>

If i put ‘hi’ or other, it works and returns the value, but if i put something to process the custom action, write in log but doesn’t returns nothing. Is like work ok from rasa to actions but can’t exit from action image.

All the code could be found here: [https://github.com/ideivitcom/rasa\_demo.git](https://github.com/ideivitcom/rasa_demo.git)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/5/547b83b2d296a87719108987478a8097073b05c6.png)

 ![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/7/74c6526f08d3544c12ff2dbc7b10dc3397497d43.png)

Custom action;:

```
class definition(Action):
    def name(self):
        return "definition"
    def run(self, dispatcher, tracker, domain):
        logger.info("Entro por aqui")
        request = requests.get('http://api.icndb.com/jokes/random').json() # make an api call
        joke = request['value']['joke'] # extract a joke from returned json response
        logger.info("Devuelvo esto: {}".format(joke))
        dispatcher.utter_message(joke) # send the message back to the user
        return []

```

End point: action\_endpoint: url: “http://action\_server:5055/webhook”

config:

# Configuration for Rasa NLU.

# [https://rasa.com/docs/rasa/nlu/components/](https://rasa.com/docs/rasa/nlu/components/)

language: en

pipeline: supervised\_embeddings

# Configuration for Rasa Core.

# [https://rasa.com/docs/rasa/core/policies/](https://rasa.com/docs/rasa/core/policies/)

policies:

- name: MemoizationPolicy

- name: KerasPolicy

- name: MappingPolicy

Docker-compose:

> ```
> version: '3.0'
> services:
> rasa:
> image: rasa/rasa:latest-full
> ports:
> - 5005:5005
> volumes:
> - ./:/app
> command:
> - run
> action_server:
> image: rasa/rasa-sdk:latest
> volumes:
> - ./actions:/app/actions
> 
> ```

---

<div class="post-metadata">

**Author:** ![Tobias\_Wochinger](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/tobias_wochinger/32/4580_2.png) [@Tobias\_Wochinger](https://forum.rasa.com/u/Tobias_Wochinger)\
**Post date:** [November 13, 2019, 8:28am UTC](https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165/2 "2019-11-13T08:28:53Z")

</div>

Can you please format your code in code blocks? That would make it way easier to read for everyone 🙂

---

<div class="post-metadata">

**Author:** ![ideivitcom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ideivitcom/32/5640_2.png) [@ideivitcom](https://forum.rasa.com/u/ideivitcom)\
**Post date:** [November 13, 2019, 8:51am UTC](https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165/3 "2019-11-13T08:51:52Z")

</div>

Done! 😅

---

<div class="post-metadata">

**Author:** ![ideivitcom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ideivitcom/32/5640_2.png) [@ideivitcom](https://forum.rasa.com/u/ideivitcom)\
**Post date:** [November 15, 2019, 7:47am UTC](https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165/4 "2019-11-15T07:47:13Z")

</div>

Can someone help me with this?

---

<div class="post-metadata">

**Author:** ![stephens](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/stephens/32/1632_2.png) [@stephens](https://forum.rasa.com/u/stephens)\
**Post date:** [November 16, 2019, 1:53am UTC](https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165/5 "2019-11-16T01:53:06Z")

</div>

In your docker-compose above I don’t see port 5055 exposed for the `action_server` although it is set correctly in your git repo.

```auto
    ports:
      - 5055:5055

```

Can you attach the log, `docker-compose logs` from a message flow that should run `action_joke`?

---

<div class="post-metadata">

**Author:** ![ideivitcom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ideivitcom/32/5640_2.png) [@ideivitcom](https://forum.rasa.com/u/ideivitcom)\
**Post date:** [November 26, 2019, 2:10pm UTC](https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165/6 "2019-11-26T14:10:13Z")

</div>

![image](https://europe1.discourse-cdn.com/flex013/uploads/rasa/original/2X/3/381196e31ddc226fc309b4043316dfee8154ed54.png)

---

<div class="post-metadata">

**Author:** ![ideivitcom](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/ideivitcom/32/5640_2.png) [@ideivitcom](https://forum.rasa.com/u/ideivitcom)\
**Post date:** [November 26, 2019, 2:11pm UTC](https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165/7 "2019-11-26T14:11:03Z")

</div>

ports: - 5055:5055

Enabled in the code.

---

<div class="post-metadata">

**Author:** ![hknajjar0](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/hknajjar0/32/6460_2.png) [@hknajjar0](https://forum.rasa.com/u/hknajjar0)\
**Post date:** [January 29, 2020, 9:22pm UTC](https://forum.rasa.com/t/example-for-custom-action-docker-compose-not-working/21165/8 "2020-01-29T21:22:28Z")

</div>

Hi, I’m struggling with this, too. Did you manage to fix it after all?
