From 16eaa5bfa1d3c8bb5345a5e3a1925586a4d8f44d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Fri, 9 Jan 2026 19:41:33 +0100 Subject: [PATCH 1/2] (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 --- docker-stack/docker-compose-standalone.yaml | 5 +++++ docker-stack/docker-compose-swarm.yml | 7 +++++-- web-app/Dockerfile | 3 --- web-app/etc/hosts | 10 ---------- 4 files changed, 10 insertions(+), 15 deletions(-) delete mode 100644 web-app/etc/hosts diff --git a/docker-stack/docker-compose-standalone.yaml b/docker-stack/docker-compose-standalone.yaml index 87ba7ab..5d03108 100644 --- a/docker-stack/docker-compose-standalone.yaml +++ b/docker-stack/docker-compose-standalone.yaml @@ -17,6 +17,11 @@ services: networks: - traefik-network - util-bills-mongo-network + # 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 diff --git a/docker-stack/docker-compose-swarm.yml b/docker-stack/docker-compose-swarm.yml index a212af8..c62ba7f 100644 --- a/docker-stack/docker-compose-swarm.yml +++ b/docker-stack/docker-compose-swarm.yml @@ -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 diff --git a/web-app/Dockerfile b/web-app/Dockerfile index 6647f68..a83f43e 100644 --- a/web-app/Dockerfile +++ b/web-app/Dockerfile @@ -38,9 +38,6 @@ COPY --from=builder /app/public/* /app/public/ # this file is required for the pdfjs-dist package COPY --from=builder /app/node_modules/pdfjs-dist/build/pdf.worker.min.mjs /app/public/pdf.worker.min.mjs -# copy custom hosts file to avoid issues with some auth providers -COPY ./etc/hosts /etc/hosts - # Automatically leverage output traces to reduce image size # https://nextjs.org/docs/advanced-features/output-file-tracing COPY --from=builder --chown=nonroot:nonroot /app/.next/standalone ./ diff --git a/web-app/etc/hosts b/web-app/etc/hosts deleted file mode 100644 index fa4a367..0000000 --- a/web-app/etc/hosts +++ /dev/null @@ -1,10 +0,0 @@ -127.0.0.1 localhost -::1 localhost ip6-localhost ip6-loopback -fe00::0 ip6-localnet -ff00::0 ip6-mcastprefix -ff02::1 ip6-allnodes -ff02::2 ip6-allrouters -# 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. -0.0.0.0 rezije.app From a428a77eb1237f38504b27c49af21ab7275fb4e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Fri, 9 Jan 2026 19:42:06 +0100 Subject: [PATCH 2/2] (ver) web-app: version bump --- web-app/package-lock.json | 4 ++-- web-app/package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web-app/package-lock.json b/web-app/package-lock.json index 707797c..639683e 100644 --- a/web-app/package-lock.json +++ b/web-app/package-lock.json @@ -1,11 +1,11 @@ { "name": "evidencija-rezija", - "version": "2.21.2", + "version": "2.21.3", "lockfileVersion": 3, "requires": true, "packages": { "": { - "version": "2.21.2", + "version": "2.21.3", "dependencies": { "@emotion/react": "^11.14.0", "@emotion/styled": "^11.14.1", diff --git a/web-app/package.json b/web-app/package.json index 3932415..d1bd25f 100644 --- a/web-app/package.json +++ b/web-app/package.json @@ -58,5 +58,5 @@ "engines": { "node": ">=18.17.0" }, - "version": "2.21.2" + "version": "2.21.3" }