Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nginx.conf does not update when containers are renamed #103

Open
Atinoda opened this issue Aug 5, 2023 · 1 comment
Open

nginx.conf does not update when containers are renamed #103

Atinoda opened this issue Aug 5, 2023 · 1 comment

Comments

@Atinoda
Copy link

Atinoda commented Aug 5, 2023

Thanks for putting together this container stack - it's certainly a complicated piece of software!

I needed to rename the containers for my application, and I'll echo #80 in saying that rename did not work for the deployment. Manually changing container names and corresponding variables in .env and docker-compose.yml got 99% of the work done however, it is also necessary to edit proxy/nginx.conf and update the frontend and backend hostnames there. I mounted the updated file directly into the container as a workaround (i.e., - ./proxy/nginx.conf:/etc/nginx/nginx.conf)

As a suggestion, librephotos-* could be used as the container naming pattern, and this is less likely to require user renaming due to conflicts with other stacks (and avoids the need to do a big rewrite for dynamic renaming capability).

@jo-chemla
Copy link

jo-chemla commented Oct 23, 2023

Thanks for the workaround, mounting - ./proxy/nginx.conf:/etc/nginx/nginx.conf in the librephotos_proxy container and adapting it from nginx.conf file!

Indeed would be great if container names were editablen directly within the docker-compose, for example through environment variables. EDIT: Actually, this interesting issue thread #87 explains that BACKEND_NAME and FRONTEND_NAME were env variables to the proxy container but are now removed.

2nd note: I was able to apply your workaround with

  • librephotos-db: only via compose file edits, namely db container_id, db container_name, proxy depends_on and backend env DB_HOST
  • librephotos-frontend: in compose (~same as above) + nginx.conf proxy_pass rows,
  • and librephotos-backend: again, backend container_id, backend container_name, proxy depends_on and backend env BACKEND_HOST + nginx.conf proxy_pass rows. Do not change proxy_set_header Host backend;!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants