From 76c8d80e592671b672469da30fda26b10e5bcc47 Mon Sep 17 00:00:00 2001 From: Jungwoo Kim Date: Wed, 14 Aug 2024 14:19:32 +0900 Subject: [PATCH] Update server-action.yml --- .github/workflows/server-action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/server-action.yml b/.github/workflows/server-action.yml index 26937a9..df66f27 100644 --- a/.github/workflows/server-action.yml +++ b/.github/workflows/server-action.yml @@ -53,7 +53,7 @@ jobs: if [ "$(sudo docker ps -q -f name=hana-server-blue)" ]; then NEW_CONTAINER_NAME="hana-server-green" OLD_CONTAINER_NAME="hana-server-blue" - PORT_MAPPING="8081:8080" # 블루가 활성화된 경우 8081 사용 + PORT_MAPPING="8081:8081" # 블루가 활성화된 경우 8081 사용 TARGET_PORT="8081" else NEW_CONTAINER_NAME="hana-server-blue" @@ -63,7 +63,7 @@ jobs: fi # 새로운 컨테이너 실행 - sudo docker run -d -p $PORT_MAPPING --name $NEW_CONTAINER_NAME --network hana_network -v /home/ubuntu/logs:/logs rlawjddn5980/hana-server:latest + sudo docker run -d -p $PORT_MAPPING --name $NEW_CONTAINER_NAME --network hana_network -v /home/ubuntu/logs:/logs -e SERVER_PORT=$TARGET_PORT rlawjddn5980/hana-server:latest sudo docker exec nginx sh -c 'sed -i "s/set \$service_ip .*/set \$service_ip \"'"$NEW_CONTAINER_NAME"'\";/" /etc/nginx/conf.d/service-url.inc; sed -i "s/set \$service_port .*/set \$service_port \"'"$TARGET_PORT"'\";/" /etc/nginx/conf.d/service-url.inc; nginx -s reload'