From 8715a54da89ab55abb3290da23c58864b62da07f Mon Sep 17 00:00:00 2001 From: Seokyun Ha Date: Sun, 17 Mar 2024 19:52:50 +0900 Subject: [PATCH] Build as Arm Arch (#10) * build ad arm * remove dev stack --- .github/workflows/github-action.yaml | 7 +++++-- docker-stack.yaml | 23 +++-------------------- nginx/poapper-api-dev.nginx | 11 ----------- 3 files changed, 8 insertions(+), 33 deletions(-) delete mode 100644 nginx/poapper-api-dev.nginx diff --git a/.github/workflows/github-action.yaml b/.github/workflows/github-action.yaml index 42d166e..ce051f6 100644 --- a/.github/workflows/github-action.yaml +++ b/.github/workflows/github-action.yaml @@ -18,6 +18,8 @@ jobs: uses: actions/checkout@v4 - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + with: + platforms: 'arm64' # support AWS EC2 t4g - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v4 with: @@ -41,6 +43,7 @@ jobs: uses: docker/build-push-action@v5 with: context: . + platforms: linux/arm64 # support AWS EC2 t4g tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} cache-from: type=gha cache-to: type=gha,mode=max @@ -52,9 +55,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Check the deployed service URL - uses: jtalk/url-health-check-action@v3 + uses: jtalk/url-health-check-action@v4 with: - url: https://api.poapper.club|https://api-dev.poapper.club + url: https://api.poapper.club follow-redirect: true max-attempts: 3 retry-delay: 10s diff --git a/docker-stack.yaml b/docker-stack.yaml index 86458f4..ee421bb 100644 --- a/docker-stack.yaml +++ b/docker-stack.yaml @@ -1,25 +1,8 @@ version: '3.3' services: - dev: - image: 151345152001.dkr.ecr.ap-northeast-2.amazonaws.com/poapper-api:latest - ports: - - 6001:4000 - secrets: - - source: poapper_api_dot_env - target: /usr/src/app/.env - logging: - driver: local - options: - max-size: 10m - deploy: - labels: - swarmpit.service.deployment.autoredeploy: 'true' - placement: - constraints: - - node.role != manager - - node.labels.application == poapper_web prod: - image: 151345152001.dkr.ecr.ap-northeast-2.amazonaws.com/poapper-api:vX.X.X + # image: 151345152001.dkr.ecr.ap-northeast-2.amazonaws.com/poapper-api:vX.X.X + image: 151345152001.dkr.ecr.ap-northeast-2.amazonaws.com/poapper-api:latest ports: - 4001:4000 secrets: @@ -35,7 +18,7 @@ services: placement: constraints: - node.role != manager - - node.labels.application == poapper_web + - node.labels.application == popo secrets: poapper_api_dot_env: diff --git a/nginx/poapper-api-dev.nginx b/nginx/poapper-api-dev.nginx deleted file mode 100644 index 8caf951..0000000 --- a/nginx/poapper-api-dev.nginx +++ /dev/null @@ -1,11 +0,0 @@ -server { - server_name api-dev.poapper.club; - client_max_body_size 10M; - - location / { - proxy_pass http://localhost:6001; - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - } -}