Allow kyoo url to be configured on docker

This commit is contained in:
Zoe Roux 2022-12-10 14:37:12 +09:00
parent d15c3ed047
commit 1cd418991c
4 changed files with 10 additions and 5 deletions

View File

@ -4,3 +4,4 @@ AUTHENTICATION_SECRET=
POSTGRES_USER=kyoousername
POSTGRES_PASSWORD=kyoopassword
POSTGRES_DB=kyooDB
PUBLIC_BACK_URL=http://localhost:5000

View File

@ -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:

View File

@ -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:

View File

@ -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*",
},
];
}