From 99aa05761b87c13629af0e9ad2adab4da98154e6 Mon Sep 17 00:00:00 2001 From: gabang2 Date: Tue, 9 Jul 2024 23:58:47 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 12 ++++++++++++ Dockerfile | 3 --- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index b92598c..ed42fb7 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -16,6 +16,18 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v1 + - name: Deploy to EC2 + run: | + echo "${{ secrets.EC2_SSH_KEY }}" > key.pem + chmod 600 key.pem + ssh -o StrictHostKeyChecking=no -i key.pem -t ec2-user@${{ secrets.EC2_INSTANCE_IP }} << 'EOF' + sudo docker pull public.ecr.aws/h7p2f6d8/ticats_ai:latest + sudo docker-compose down + sudo docker-compose up -d + EOF + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} + - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: diff --git a/Dockerfile b/Dockerfile index c7f1688..474e44c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,6 @@ FROM python:3.9 # 작업 디렉토리 설정 WORKDIR /code -# 필요한 라이브러리 설치 -RUN apt-get update && apt-get install -y libxcrypt-compat - # 종속성 파일 복사 및 설치 COPY ./requirements.txt /code/ RUN pip install --no-cache-dir --upgrade -r requirements.txt