Open davidmalis opened 2 years ago
Hey!
Glad you figured it out. Can you explain a bit more in-depth why you would need to do that? I'm not sure I understood why you needed this.
Sure thing,
basically I'm using templates for NGINX configuration (described here).
And one of the scripts inside NGINX's /docker-entrypoint.d
, namely 20-envsubst-on-templates.sh
is crucial to me, because it's responsible for moving /etc/nginx/templates/*.template
files into the /etc/nginx/conf.d
dir, while replacing placeholders inside with envsubst
.
When I introduced your lib (which is awesome, btw), my usual pipelines and deployments stopped working. Basically my NGINX based containers would not have my custom configuration in place, but rather the default one which comes with the NGINX, and that happened because your example said to put a specific CMD [...] in Dockerfile, which is doing what it should, but it makes the NGINX /docker-entrypoint.sh
skip all its job, including the above script.
Ah, I see, okay. You have a very custom setup script then :)
Can you create some detailed instructions on how one can achieve this?
I'm happy to update the README for this use-case. I can also play around with it later to see what could be the best solution.
When using a CMD from the example for usage in Docker environments, the NGINX default entrypoint (
/.docker-entrypoint.sh
) skips running configuration scripts inside/docker-entrypoint.d
NGINX ships with three of these scripts by default (please see here: https://github.com/nginxinc/docker-nginx/tree/04226fe92cc11bed68dae464eb60fd5399daf3b1/mainline/alpine)
I was able to get arround this issue by moving the execution of
runtime-env-cra
into my own custom script which I put into the/docker-entrypoint.d
, like so:When the container is started, the entrypoint executes scripts from the
/docker-entrypoint.d
(including myruntime-env-cra
script) and then starts the NGINX process.