From d5c2476056499cf9148bd6ad982ad9e192c8c78a Mon Sep 17 00:00:00 2001 From: gurdl7011 Date: Thu, 19 Oct 2023 17:25:53 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=9D=20::=20env?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ecr-push.yml | 4 ++-- Dockerfile | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ecr-push.yml b/.github/workflows/ecr-push.yml index 8dbc2ac..bdc0b76 100644 --- a/.github/workflows/ecr-push.yml +++ b/.github/workflows/ecr-push.yml @@ -5,7 +5,7 @@ on: branches: [ "main" ] jobs: - deploy: + CI-CD: runs-on: ubuntu-latest steps: @@ -52,7 +52,7 @@ jobs: SENDER: ${{ secrets.SENDER }} REDIS_HOST: ${{ secrets.REDIS_HOST }} run: | - docker buildx build --platform=linux/amd64 -e -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . + docker buildx build --platform=linux/amd64 --build-arg ACCESS_EXP=ACCESS_EXP --build-arg API_KEY=API_KEY --build-arg API_SECRET=$API_SECRET --build-arg BUCKET=$BUCKET --build-arg DB_PASSWORD=$DB_PASSWORD --build-arg DB_URL=$DB_URL --build-arg DB_USER=$DB_USER --build-arg DIRECTORY=$DIRECTORY --build-arg IAM_ACCESS=$IAM_ACCESS --build-arg IAM_SECRET=$IAM_SECRET --build-arg JWT_SECRET=$JWT_SECRET --build-arg REFRESH_EXP=$REFRESH_EXP --build-arg SENDER=$SENDER --build-arg REDIS_HOST=$REDIS_HOST -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG . docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG echo "::set-output name=image::$ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG" diff --git a/Dockerfile b/Dockerfile index 2591de6..f4bfbff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,20 @@ FROM openjdk:17-jdk-slim COPY --from=builder /app.jar /app.jar ENV TZ=Asia/Seoul + ACCESS_EXP=${ACCESS_EXP} + API_KEY=${API_KEY} + API_SECRET=${API_SECRET} + BUCKET=${BUCKET} + DB_PASSWORD=${DB_PASSWORD} + DB_URL=${DB_URL} + DB_USER=${DB_USER} + DIRECTORY=${DIRECTORY} + IAM_ACCESS=${IAM_ACCESS} + IAM_SECRET=${IAM_SECRET} + JWT_SECRET=${JWT_SECRET} + REFRESH_EXP=${REFRESH_EXP} + SENDER=${SENDER} + REDIS_HOST=${REDIS_HOST} EXPOSE 8080