Closed replete closed 1 week ago
Sure! Here is the updated translation with an example and link:
Hi @replete,
You can try using the chown
option for the COPY
command in the Dockerfile. This approach will make the container start faster and be more stable since it avoids executing I/O commands every time it starts up.
For example:
FROM shinsenter/statamic:latest-alpine
COPY --chown=$APP_USER:$APP_GROUP ./statamic /var/www/html
RUN apk add --no-cache nodejs npm \
&& cd /var/www/html \
&& npm install \
&& npm run build
EXPOSE 567
This way, Docker will automatically fix the owner permissions during the copy process for you, instead of you having to run wait-and-chown.sh
manually during container startup.
You can find more details in the Docker documentation: COPY command documentation.
@shinsenter A true docker professional, thanks so much!
This is what my dockerfile looks like to get around the complaints about storage folder permissions: