# Permission denied when using custom docker-compose

**URL:** <https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024>\
**Category:** Rasa Open Source\
**Created:** [January 31, 2022, 7:03pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024 "2022-01-31T19:03:38Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpark2111](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jpark2111](https://forum.rasa.com/u/jpark2111)\
**Post date:** [January 31, 2022, 7:03pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/1 "2022-01-31T19:03:38Z")

</div>

Hi,

I’m using custom docker-compose to run rasa on VM(ubuntu-20.04), I’m getting error PermissionError: [Errno 13] Permission denied: ‘models’

docker-compose file is in etc/rasa directory, I also did this command `sudo chgrp -R root /etc/rasa/* && sudo chmod -R 770 /etc/rasa/*` but still get same error.

What am I missing?

FYI, model is trained already once docker image was built

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [January 31, 2022, 9:23pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/2 "2022-01-31T21:23:03Z")

</div>

@jpark2111 can you share the actual error screenshot from the docker logs ?

---

<div class="post-metadata">

**Author:** ![jpark2111](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jpark2111](https://forum.rasa.com/u/jpark2111)\
**Post date:** [January 31, 2022, 9:33pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/3 "2022-01-31T21:33:01Z")

</div>

```auto
2022-01-31 19:29:46 WARNING rasa.utils.common - Failed to write global config. Error: [Errno 13] Permission denied: '/.config'. Skipping.
Traceback (most recent call last):
  File "/usr/local/bin/rasa", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/rasa/ __main__.py", line 118, in m ain
    cmdline_arguments.func(cmdline_arguments)
  File "/usr/local/lib/python3.8/site-packages/rasa/cli/run.py", line 118, in ru n
    args.model = _validate_model_path(args.model, "model", DEFAULT_MODELS_PATH)
  File "/usr/local/lib/python3.8/site-packages/rasa/cli/run.py", line 71, in _va lidate_model_path
    os.makedirs(default, exist_ok=True)
  File "/usr/local/lib/python3.8/os.py", line 223, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: 'models'

```

this message keeps repeating, as the docker container keeps restarting @nik202

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [January 31, 2022, 10:48pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/4 "2022-01-31T22:48:17Z")

</div>

@jpark2111 I know the solution but me confused, please share the all `docker` and `docker-compose` files and even `docker ps` screenshots. Thanks.

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [January 31, 2022, 10:52pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/5 "2022-01-31T22:52:02Z")

</div>

> [@jpark2111](#):
>
> docker-compose file is in etc/rasa directory, I also did this command `sudo chgrp -R root /etc/rasa/* && sudo chmod -R 770 /etc/rasa/*` but still get same error.

This is used for Rasa X [https://rasa.com/docs/rasa-x/0.42.x/installation-and-setup/install/docker-compose#4-configure](https://rasa.com/docs/rasa-x/0.42.x/installation-and-setup/install/docker-compose#4-configure)

and you sharing me Rasa Open Source debug ?

Please clear me what are you trying to archive?

Confirm me please:

1. Do you trying to run code using Rasa X ? OR
2. Do you trying to run code using Rasa open-source with docker and docker-compose?

Thanks.

---

<div class="post-metadata">

**Author:** ![jpark2111](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jpark2111](https://forum.rasa.com/u/jpark2111)\
**Post date:** [January 31, 2022, 11:14pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/6 "2022-01-31T23:14:50Z")

</div>

trying to run rasa open source with docker and docker-compose. @nik202

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [January 31, 2022, 11:17pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/7 "2022-01-31T23:17:08Z")

</div>

@jpark2111 Now make sense to me 🙂

Can you share the docker files please quickly?

---

<div class="post-metadata">

**Author:** ![jpark2111](https://avatars.discourse-cdn.com/v4/letter/j/74df32/32.png) [@jpark2111](https://forum.rasa.com/u/jpark2111)\
**Post date:** [January 31, 2022, 11:49pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/8 "2022-01-31T23:49:02Z")

</div>

```auto
FROM python:3.8-slim

WORKDIR /app
COPY . /app

RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
RUN python -m spacy download en_core_web_md 
RUN python -m spacy link en_core_web_md en

RUN rasa train

USER 1001

ENTRYPOINT ["rasa"]

CMD ["run", "--enable-api", "--port", "8080"]

```

@nik202

---

<div class="post-metadata">

**Author:** ![nik202](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/nik202/32/16098_2.png) [@nik202](https://forum.rasa.com/u/nik202)\
**Post date:** [January 31, 2022, 11:51pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/9 "2022-01-31T23:51:35Z")

</div>

@jpark2111 there is no rasa install and why are you using Python 3.8-slim if you are not creating any env?

@jpark2111

**For Demo use only:**

```auto
FROM rasa/rasa:2.8.0
WORKDIR '/app'
COPY . /app
USER root
# WORKDIR /app
# COPY . /app
COPY ./data /app/data
RUN rasa train
VOLUME /app
VOLUME /app/data
VOLUME /app/models
CMD ["run","-m","/app/models","--enable-api","--cors","*","--debug" ,"--endpoints", "endpoints.yml", "--log-file", "out.log", "--debug"]

```

Try to update your docker file, take something from code 🙂

OR

Just try to mention `USER root` in your file and check. But, I have a doubt it will not run again.

Even, your run command doesn’t have the model and you also do not mount the model in the docker container, show how he will run the model?

The solution here is `USER root` that’s why it shows **Permission denied.**

@jpark2111 For running completely code in docker and docker-compose for Rasa Open source please visit this thread: [Dockerizing my rasa chatbot application that has botfront - #11 by nik202](http://forum.rasa.com/t/dockerizing-my-rasa-chatbot-application-that-has-botfront/46096/11)

If you still have some burning questions or doubt, you know I’m here 🙂 Good Luck! I hope this will help you.

---

<div class="post-metadata">

**Author:** ![ChrisRahme](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.rasa.com/chrisrahme/32/15572_2.png) [@ChrisRahme](https://forum.rasa.com/u/ChrisRahme)\
**Post date:** [February 2, 2022, 8:28pm UTC](https://forum.rasa.com/t/permission-denied-when-using-custom-docker-compose/51024/10 "2022-02-02T20:28:38Z")

</div>

29 posts were split to a new topic: [Cannot hit REST Webhook on Azure Server](https://forum.rasa.com/t/cannot-hit-rest-webhook-on-azure-server/51085)
