diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2aa7a44..ebab83f 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -57,8 +57,7 @@ jobs: docker push $DOCKER_HUB_USERNAME/backend:latest cd ../ai - echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" >> .env - docker build -t $DOCKER_HUB_USERNAME/ai:latest . + docker build --build-arg OPENAI_API_KEY="${{ secrets.OPENAI_API_KEY }}" -t $DOCKER_HUB_USERNAME/ai:latest . docker push $DOCKER_HUB_USERNAME/ai:latest # Backend 서비스 배포 (AWS Systems Manager 사용) diff --git a/ai/Dockerfile b/ai/Dockerfile index b46f7d9..73b5187 100644 --- a/ai/Dockerfile +++ b/ai/Dockerfile @@ -18,7 +18,8 @@ RUN pip install --no-cache-dir -r requirements.txt # 프로젝트 파일 복사 COPY . . -COPY .env .env +ARG OPENAI_API_KEY +ENV OPENAI_API_KEY=$OPENAI_API_KEY # 데이터 저장을 위한 디렉토리 생성 RUN mkdir -p /app/data