From d50eaed06b2c4202ebc584cd1db589735cc74dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cadashkdy9960?= <â€vjftmxmwlwhs@gmail.com> Date: Mon, 15 Jan 2024 12:26:38 +0900 Subject: [PATCH] =?UTF-8?q?script:=20=EB=8F=84=EC=BB=A4=20=EC=BB=B4?= =?UTF-8?q?=ED=8F=AC=EC=A6=88=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/gradle.yml | 13 ++++--------- docker-compose.yaml | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 6f0e1da..58d40f1 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -49,12 +49,7 @@ jobs: key: ${{ secrets.AWS_SSH_KEY }} port: 22 script: | - if docker ps -a --format '{{.ID}}' | grep -q .; then - sudo docker rm -f $(docker ps -qa) - else - echo "No Docker containers to remove." - fi - sudo docker pull ${{ secrets.DOCKERHUB_USERNAME }}/hhive - sudo docker run --name hhive -d ${{ secrets.DOCKERHUB_USERNAME }}/hhive - sudo docker run --name redis-server -d -p 6379:6379 redis - docker image prune -f + docker rm -f $(docker ps -qa) + docker rmi ${{ secrets.DOCKERHUB_USERNAME }} + docker pull ${{ secrets.DOCKERHUB_USERNAME }} + docker-compose up -d diff --git a/docker-compose.yaml b/docker-compose.yaml index e7c7823..aadd019 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -17,8 +17,22 @@ services: - --collation-server=utf8mb4_unicode_ci restart: always + spring-app: + build: + context: ./spring-app + dockerfile: Dockerfile + ports: + - "8080:8080" + depends_on: + - mysql-db + restart: always - + redis: + image: redis:latest + container_name: redis-server + ports: + - "6379:6379" + restart: always