docker
docker copied to clipboard
The craftcms/nginx:<ver>-dev images on Docker Hub do not load nitro.conf
Description
In 1.2.7 the ability to add a nitro.conf file to the root was added and it to be included in the default.conf nginx config. This only fails to work for nginx images 7.3-8.0 however and 7.0-7.2 are fine.
Steps to reproduce
- start up a container using any of the craftcms/nginx:
-dev images on docker hub (except 7.0-7.2) - ssh into the container and look at the /etc/nginx/conf.d/default.conf file and see it is the production file and doesn't include
include /app/*nitro.conf;
You can also inspect the layers of any of those images and see that NGINX_CONF is set to default.conf instead of dev.default.conf
Thanks for reporting – I was able to verify and reproduce this. Just pushed out a new version of the images that should fix this (new images are currently building).
❯ docker run -it --entrypoint cat craftcms/nginx:8.0-dev /etc/nginx/conf.d/default.conf | grep nitro
# include custom configuration for nitro
include /app/*nitro.conf;
Hmm, it doesn't look like it worked, the images on docker hub still have the production default.conf
Yeah, I'm debugging the build pipeline…hoping this one will work: https://github.com/craftcms/docker/actions/runs/1287565862
Just takes a while for them to all build. I'll verify with a final test and post here before I close.
I've figured out the issue, the ARG in the docker file is NGINX_CONF but the build-arg in build-and-push.yml is NGINX_CONFIG
@Kethatril you're my hero. Thanks for the 🕵️ work. Pushing out new images now.
🤞 https://github.com/craftcms/docker/actions/runs/1288374822
Took me a bit ha, my brain kept skipping over it. I was sure it was something to do with the build args, but my brain kept insisting that NGINX_CONF was identical to NGINX_CONFIG.