strapi / strapi-docker

Install and run your first Strapi project using Docker
https://strapi.io
MIT License
1.16k stars 447 forks source link

CMS directory still being created as "root" #263

Closed baranelitez closed 3 years ago

baranelitez commented 3 years ago

Hi. I know this has been mentioned multiple times and closed (once due to moving to beta, the other claiming the issue was fixed in a recent update). But the issue is still present.

238

107

just referencing the strapi/strapi image with a plain docker-compose.yml, and upping it creates the directory being owned by "root". running docker run -it -p 1337:1337 -vpwd/project-name:/srv/app strapi/strapi results in the directory created for the root user as well.

Thanks and have a nice day!

alexandrebodin commented 3 years ago

Hi @baranelitez, what version of the image are you using ? did you pull a recent version ?

baranelitez commented 3 years ago

yes, i've pulled the recent version, assuming strapi/strapi gets me the latest one from the hub.

polaroidkidd commented 3 years ago

I am also experiencing this issue. I can sudo chown -R $USER ./app but that doesn't include new content types created via the UI.

guicara commented 3 years ago

Hello,

I have the same problem with a fresh install of Strapi using the Docker Compose file from the official documentation: https://strapi.io/documentation/developer-docs/latest/installation/docker.html

As you can see below, all the files are created as root:

$ ls -al
total 20
drwxrwxr-x 4 user             user 4096 déc.  29 21:09 .
drwxrwxr-x 6 user             user 4096 déc.  29 21:05 ..
drwxr-xr-x 9 root             root 4096 déc.  29 21:11 app
drwxr-xr-x 5 systemd-coredump root 4096 déc.  29 21:14 data
-rw-rw-r-- 1 user             user  587 déc.  29 21:05 docker-compose.yaml
$ ls -al app/
total 556
drwxr-xr-x    9 root root   4096 déc.  29 21:11 .
drwxrwxr-x    4 user user   4096 déc.  29 21:09 ..
drwxr-xr-x    2 root root   4096 déc.  29 21:09 api
drwxr-xr-x    2 root root   4096 déc.  29 21:11 build
drwxr-xr-x    6 root root   4096 déc.  29 21:11 .cache
drwxr-xr-x    3 root root   4096 déc.  29 21:09 config
-rw-r--r--    1 root root    249 déc.  29 21:09 .editorconfig
-rw-r--r--    1 root root     23 déc.  29 21:09 .env.example
-rw-r--r--    1 root root     32 déc.  29 21:09 .eslintignore
-rw-r--r--    1 root root    541 déc.  29 21:09 .eslintrc
drwxr-xr-x    3 root root   4096 déc.  29 21:11 extensions
-rw-r--r--    1 root root   3688 déc.  29 21:09 favicon.ico
-rw-r--r--    1 root root   1157 déc.  29 21:09 .gitignore
drwxr-xr-x 1041 root root  36864 déc.  29 21:11 node_modules
-rw-r--r--    1 root root    890 déc.  29 21:09 package.json
drwxr-xr-x    3 root root   4096 déc.  29 21:09 public
-rw-r--r--    1 root root     69 déc.  29 21:09 README.md
-rw-------    1 root root     57 déc.  29 21:11 .strapi-updater.json
-rw-r--r--    1 root root 460032 déc.  29 21:11 yarn.lock

My Docker installation is configured to run as non-root user (as described here).

The strapi/strapi image is the latest:

$ docker image inspect strapi/strapi
[
    {
        "Id": "sha256:44b51db1c3b06a0b38e5be35fb9ceb25880487518f8d08e32adef422041e8f1f",
        "RepoTags": [
            "strapi/strapi:latest"
        ],
        "RepoDigests": [
            "strapi/strapi@sha256:4f60623a8d53e8d6f7de247f95486654c9b54b4de41af9948d9fb47a25e9abfd"
        ],
        ...
    }
]

107 issue should not be marked as resolved.

Unfortunately, this commit does not work as expected.

For information:

$ docker -v
Docker version 20.10.1, build 831ebea

$ docker-compose --version 
docker-compose version 1.27.4, build 40524192

$ id
uid=1000(user) gid=1000(user)

Thanks

alexandrebodin commented 3 years ago

Closing in favor of the original issue https://github.com/strapi/strapi-docker/issues/107