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'