File tree Expand file tree Collapse file tree 1 file changed +19
-5
lines changed
Expand file tree Collapse file tree 1 file changed +19
-5
lines changed Original file line number Diff line number Diff line change 5858 username : ${{ secrets.EC2_USER }}
5959 key : ${{ secrets.EC2_SSH_PRIVATE_KEY }}
6060 script : |
61- cd didacto-testserver
62- sudo docker-compose stop
63- sudo docker-compose rm -f
64- sudo docker rmi sjh9708/didacto-app-dev:latest
65- sudo docker-compose up -d
61+ IMAGE_NAME=${{ secrets.DOCKER_USERNAME }}/didacto-app-dev
62+ CONTAINER_NAME=didacto-app
63+
64+ # 기존 컨테이너 중지 및 삭제
65+ sudo docker stop $CONTAINER_NAME || true
66+ sudo docker rm $CONTAINER_NAME || true
67+
68+ # 기존 이미지 삭제
69+ sudo docker rmi $IMAGE_NAME || true
70+
71+ # 최신 이미지 가져오기
72+ sudo docker pull $IMAGE_NAME
73+
74+ # 새 컨테이너 실행
75+ sudo docker run -d \
76+ --name $CONTAINER_NAME \
77+ -p 80:8080 \
78+ -e SPRING_PROFILES_ACTIVE=prod \
79+ $IMAGE_NAME
You can’t perform that action at this time.
0 commit comments