-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
I noticed that on Ubuntu, the user is not correctly set to appuser:appgroup
My custom Dockerfie looks like this.
FROM ghcr.io/craftcms/image:8.4
USER root
COPY .docker/local/craft/${nginx_config} /etc/nginx/nginx.conf
COPY .docker/local/craft/supervisord.conf/nginx.ini /etc/supervisord.d/nginx.ini
# set the sockets and pid files to be writable by the appuser
RUN mkdir -p /var/log/nginx && chown -R appuser:appgroup /var/log/nginx
RUN chown -R appuser:appgroup /var/lib/nginx && touch /run/nginx.pid && chown -R appuser:appgroup /run/nginx.pid
# make sure pg_dump (17) is available
RUN curl -fsSL https://www.postgresql.org/media/keys/ACCC4CF8.asc|gpg --dearmor --yes -o /etc/apt/trusted.gpg.d/postgresql.gpg && \
echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" |tee /etc/apt/sources.list.d/pgdg.list
RUN ["apt-get", "update", "--allow-releaseinfo-change"]
RUN ["apt-get", "install", "-y", "zsh", "nano", "postgresql-client-17", "composer"]
COPY --chown=appuser:appgroup . .
USER appuser
On macOS this works smoothly. Not so on Ubuntu. All files/dirs have ubuntu as the user:group
Additional info
- Craft version: 4.x
- PHP version: 8.4
- Database driver & version: PG 17
- Plugins & versions:
Fix
docker compose exec -it -u root web zsh and cd /app && chown -R appuser:appgroup . Fixed this.
I am guessing my COPY statement is wrong?!
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working