diff --git a/.env.example b/.env.example index 86bc1719..5021a686 100644 --- a/.env.example +++ b/.env.example @@ -4,3 +4,4 @@ AUTHENTICATION_SECRET= POSTGRES_USER=kyoousername POSTGRES_PASSWORD=kyoopassword POSTGRES_DB=kyooDB +PUBLIC_BACK_URL=http://localhost:5000 diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index a765b0fa..f63740f3 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -38,7 +38,7 @@ services: - "19000:19000" restart: on-failure environment: - - KYOO_URL=http://back:5000 + - KYOO_URL=${KYOO_URL:-http://back:5000} - PUBLIC_BACK_URL=${PUBLIC_BACK_URL} ingress: image: nginx @@ -46,7 +46,7 @@ services: environment: - PORT=8901 - FRONT_URL=http://front:3000 - - BACK_URL=http://back:5000 + - BACK_URL=${KYOO_URL:-http://back:5000} volumes: - ./nginx.conf.template:/etc/nginx/templates/kyoo.conf.template:ro depends_on: diff --git a/docker-compose.yml b/docker-compose.yml index ab15b80a..a96cb7b8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,14 +22,15 @@ services: build: ./front restart: on-failure environment: - - KYOO_URL=http://back:5000 + - KYOO_URL=${KYOO_URL:-http://back:5000} + - PUBLIC_BACK_URL=${PUBLIC_BACK_URL} ingress: image: nginx restart: on-failure environment: - PORT=8901 - FRONT_URL=http://front:8901 - - BACK_URL=http://back:5000 + - BACK_URL=${KYOO_URL:-http://back:5000} volumes: - ./nginx.conf.template:/etc/nginx/templates/kyoo.conf.template:ro depends_on: diff --git a/front/apps/web/next.config.js b/front/apps/web/next.config.js index 5d0ee357..f64b3bde 100755 --- a/front/apps/web/next.config.js +++ b/front/apps/web/next.config.js @@ -102,7 +102,10 @@ const nextConfig = { if (process.env.NODE_ENV !== "production") { nextConfig.rewrites = async () => [ - { source: "/api/:path*", destination: process.env.KYOO_URL ?? "http://localhost:5000/:path*" }, + { + source: "/api/:path*", + destination: `${process.env.KYOO_URL}/:path*` ?? "http://localhost:5000/:path*", + }, ]; }