Skip to content

Commit

Permalink
Fix Dockerfile permission issues
Browse files Browse the repository at this point in the history
On docker build after changes from:
kausaltech#46
and
kausaltech#47
there is a build error still:
```
$ podman-compose  -f docker-compose.dev.yml  -f docker-compose.yml --podman-build-args="--security-opt label=disable" up --build --build-arg INSTALL_DEV_DEPS=0 --build-arg BUILD_ID=0
...
Execution of msgfmt failed: msgfmt: error while opening "/venv/lib/python3.12/site-packages/django_filters/locale/fi/LC_MESSAGES/django.mo" for writing: Permission denied
...
CommandError: compilemessages generated one or more errors.
```

The change fixes permission errors by adding required dirs to `chown -R`
call.

After this build finally succeeds.

Note that I ran `podman-compose` because Fedora comes with `podman`, not
`docker`, yet here the behavior of `podman` and `docker` are identical.
  • Loading branch information
rominf committed Jun 27, 2024
1 parent 87df7f9 commit c752f47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker/app/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ ENV MEDIA_ROOT=${MEDIA_ROOT}
RUN mkdir -p ${MEDIA_ROOT} ${STATIC_ROOT}

RUN groupadd -g ${app_user_gid} user && useradd --no-log-init -m -d /home/user -g ${app_user_gid} -u ${app_user_uid} -r user
RUN chown -R user:user /code /srv/media /srv/static
RUN chown -R user:user /code /locale /venv /srv/media /srv/static

# Switch to the app user
USER user
Expand Down

0 comments on commit c752f47

Please sign in to comment.