From c153573638ac7ea6aee18218336da35859c1babc Mon Sep 17 00:00:00 2001 From: Gyehyun Park Date: Fri, 25 Oct 2024 02:30:20 +0900 Subject: [PATCH] test: deploy test --- .github/workflows/deploy.yml | 34 +--------------------------------- docker-compose.yml | 32 -------------------------------- 2 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 docker-compose.yml diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 29284e8..8c6fef6 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -54,39 +54,7 @@ jobs: key: ${{ secrets.EC2_PRIVATE_KEY }} script_stop: true script: | - # 네트워크 생성 (이미 존재할 경우 무시) - docker network create cano-network || echo "Network already exists" - - # MySQL 컨테이너 중지 및 삭제 - docker stop mysql-container || true - docker rm mysql-container || true - - # MySQL 이미지 풀 - docker pull mysql:5.7 - - # MySQL 컨테이너 실행 - docker run -d --name mysql-container \ - --network cano-network \ # 네트워크 지정 - -e MYSQL_ROOT_PASSWORD=password123 \ - -e MYSQL_DATABASE=cano \ - -e MYSQL_USER=root \ - -e MYSQL_PASSWORD=password123 \ - -v mysql-data:/var/lib/mysql \ - -p 3306:3306 \ - mysql:5.7 - - # 기존 Spring Boot 컨테이너 중지 및 삭제 docker stop cano-server || true docker rm cano-server || true - - # Spring Boot 이미지 풀 docker pull ${{ steps.login-ecr.outputs.registry }}/cano-server:latest - - # Spring Boot 컨테이너 실행 - docker run -d --name cano-server \ - --network cano-network \ # 네트워크 지정 - -p 8080:8080 \ - -e SPRING_DATASOURCE_URL=jdbc:mysql://mysql-container:3306/cano \ # MySQL 컨테이너 이름으로 수정 - -e SPRING_DATASOURCE_USERNAME=root \ - -e SPRING_DATASOURCE_PASSWORD=password123 \ - ${{ steps.login-ecr.outputs.registry }}/cano-server:latest \ No newline at end of file + docker run -d --name cano-server --network cano-network -p 8080:8080 ${{ steps.login-ecr.outputs.registry }}/cano-server:latest \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 513267f..0000000 --- a/docker-compose.yml +++ /dev/null @@ -1,32 +0,0 @@ -version: '3.8' - -services: - mysql: - image: mysql:5.7 - restart: always - environment: - MYSQL_ROOT_PASSWORD: password123 - MYSQL_DATABASE: cano - MYSQL_USER: root - MYSQL_PASSWORD: password123 - ports: - - "3306:3306" - volumes: - - mysql-data:/var/lib/mysql - - springboot-app: - build: - context: . - dockerfile: Dockerfile - restart: always - environment: - SPRING_DATASOURCE_URL: jdbc:mysql://mysql:3306/cano - SPRING_DATASOURCE_USERNAME: root - SPRING_DATASOURCE_PASSWORD: password123 - ports: - - "8080:8080" - depends_on: - - mysql - -volumes: - mysql-data: