From 535e57698ba2e9e64fd9576bd9eb1f730d644f4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Dere=C5=BEi=C4=87?= Date: Mon, 15 Jan 2024 14:35:50 +0100 Subject: [PATCH] modified NextJS publishing port --- docker-compose-deploy.yml | 4 ++-- etc/hosts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/docker-compose-deploy.yml b/docker-compose-deploy.yml index 11e7f63..82bdf4e 100644 --- a/docker-compose-deploy.yml +++ b/docker-compose-deploy.yml @@ -19,7 +19,7 @@ services: AUTH_SECRET: Gh0jQ35oq6DR8HkLR3heA8EaEDtxYN/xkP6blvukZ0w= HOSTNAME: rezije.app # IP address at which the server will be listening (0.0.0.0 = listen on all addresses) EXTAUTH_URL: ${HOSTNAME:-https://rezije.app} # URL next-auth will use while redirecting user during authentication (if not set - will use HOSTNAME) - PORT: ${PORT:-3000} + PORT: ${PORT:-80} deploy: # u slucaju rušenja kontejnera čekamo 5s i dižemo novi kontejner => ako se i on sruši opet ceka 5s i pokusava ponovno (tako 5 puta) restart_policy: @@ -29,7 +29,7 @@ services: labels: - traefik.enable=true - traefik.docker.network=traefik-network # mreže preko koje ide komunikacija sa Traefikom - - traefik.http.services.web-app.loadbalancer.server.port=3000 + - traefik.http.services.web-app.loadbalancer.server.port=80 - traefik.http.routers.web-app.entrypoints=http - traefik.http.routers.web-app.rule=Host(`${FQDN:-rezije.app}`) mongo: diff --git a/etc/hosts b/etc/hosts index 5a31167..fa4a367 100644 --- a/etc/hosts +++ b/etc/hosts @@ -4,4 +4,7 @@ fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters -127.0.0.1 rezije.app +# 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