diff --git a/deploy/stage/Dockerfile b/deploy/stage/Dockerfile index 5d339a1..c45387b 100644 --- a/deploy/stage/Dockerfile +++ b/deploy/stage/Dockerfile @@ -19,3 +19,10 @@ RUN { \ ENV TZ=Asia/Seoul RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN printf '#!/bin/sh\ncp /var/www/html/mouse_typing/index.html /var/www/html/index.html\nexec "$@"\n' \ + > /usr/local/bin/entrypoint.sh \ + && chmod +x /usr/local/bin/entrypoint.sh + +ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] +CMD ["apache2-foreground"] diff --git a/deploy/stage/deploy-stage.sh b/deploy/stage/deploy-stage.sh index 42fb365..66599da 100644 --- a/deploy/stage/deploy-stage.sh +++ b/deploy/stage/deploy-stage.sh @@ -19,5 +19,9 @@ fi echo "=== [3/3] docker compose up ===" docker compose -f $BASE_DIR/docker-compose.yml up -d +if [ $? -ne 0 ]; then + echo "docker compose up 실패. 배포 중단." + exit 1 +fi echo "=== 배포 완료 ===" \ No newline at end of file