(bugfix) Fix hosts file configuration by using extra_hosts at runtime
Docker overwrites /etc/hosts at container runtime, so copying it during build (COPY command) or mounting it as volume doesn't work reliably. Moved to extra_hosts in docker-compose files for both standalone and swarm deployments. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -17,8 +17,11 @@ services:
|
||||
networks:
|
||||
- traefik-network
|
||||
- util-bills-mongo-network
|
||||
volumes:
|
||||
- ./web-app/etc/hosts/:/etc/hosts
|
||||
# NextJS will do name resolution for `rezije.app` and will crash if it
|
||||
# resolves to an IP adress different from the one assigned to the Docker container.
|
||||
# This will prevent that from happening.
|
||||
extra_hosts:
|
||||
- "rezije.app:0.0.0.0"
|
||||
environment:
|
||||
MONGODB_URI: mongodb://rezije.app:w4z4piJBgCdAm4tpawqB@mongo:27017/utility-bills
|
||||
GOOGLE_ID: 355397364527-adjrokm6hromcaaar0qfhk050mfr35ou.apps.googleusercontent.com
|
||||
|
||||
Reference in New Issue
Block a user