From 7a4bce7c31463300819f32f6953ce8acdb6f6243 Mon Sep 17 00:00:00 2001 From: 4gray Date: Thu, 2 Feb 2023 22:19:11 +0100 Subject: [PATCH] chore: introduce BACKEND_URL for docker deployment --- docker/Dockerfile | 2 +- docker/docker-compose.yml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index dc3403955..db5d14518 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -28,4 +28,4 @@ FROM nginx:stable-alpine COPY --from=build /usr/src/app/dist/ /usr/share/nginx/html COPY --from=build /usr/src/app/docker/nginx.conf /etc/nginx/conf.d/default.conf -CMD sed -i "s/localhost:3333/localhost:$BACKEND_PORT/g" /usr/share/nginx/html/main.*.js && nginx -g 'daemon off;' \ No newline at end of file +CMD sed -i "s#http://localhost:3333#$BACKEND_URL#g" /usr/share/nginx/html/main.*.js && nginx -g 'daemon off;' \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index f6d92a38e..3fad31ac1 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -6,12 +6,12 @@ services: ports: - "7333:3000" environment: - - CLIENT_URL=http://localhost:4333 + - CLIENT_URL=http://localhost:4333 #this one should match with the address and port in frontend CLIENT_URL env frontend: image: 4gray/iptvnator:latest ports: - - "4333:80" #this one should match with the port in CLIENT_URL env + - "4333:80" environment: - - BACKEND_PORT=7333 # this one should match with the exposed port of the backend service + - BACKEND_URL=http://192.168.172.67:7333 # this one should match with the address of the backend service \ No newline at end of file