-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add docker relates * udpate docker script * one step dockerfile * add .env relates * npm audit fix * sync gh action pattern * update endpoint * update dockerfile * setup nginx config * use npm ci * update people api endpoint * update gh action * dockerization final * copy dotenv * update docker cmd * update dockerfile * update docker stack * people tags, badges * tags, badges null handling * update PersonCard null
- Loading branch information
1 parent
4c4277e
commit cec7626
Showing
11 changed files
with
7,392 additions
and
6,360 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# add git-ignore syntax here of things you don't want copied into docker image | ||
|
||
.git | ||
*Dockerfile* | ||
*docker-compose* | ||
node_modules | ||
|
||
.env | ||
.github | ||
.husky |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
GATSBY_API_URL="https://api.poapper.club" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
on: | ||
push: | ||
release: | ||
types: [published] | ||
|
||
name: Docker Build and Push | ||
|
||
env: | ||
ECR_REGISTRY: 151345152001.dkr.ecr.ap-northeast-2.amazonaws.com | ||
ECR_REPOSITORY: poapper-homepage | ||
|
||
jobs: | ||
docker_build_and_push: | ||
name: Docker build and push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: ap-northeast-2 | ||
- name: Login to Amazon ECR | ||
uses: aws-actions/amazon-ecr-login@v1 | ||
with: | ||
mask-password: 'true' | ||
- name: Determine Prod/Dev Stage | ||
run: | | ||
if [[ ${{ github.event_name }} == 'release' ]]; then | ||
echo "PROD" | ||
echo "IMAGE_TAG=${{ github.event.release.tag_name }}" >> $GITHUB_ENV | ||
else | ||
echo "DEV" | ||
echo "IMAGE_TAG=latest" >> $GITHUB_ENV | ||
fi | ||
- name: Build and Push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
tags: ${{ env.ECR_REGISTRY }}/${{ env.ECR_REPOSITORY }}:${{ env.IMAGE_TAG }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
push: true | ||
|
||
deploy_health_check: | ||
name: Check Application Status | ||
needs: docker_build_and_push | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check the deployed service URL | ||
uses: jtalk/url-health-check-action@v3 | ||
with: | ||
url: https://poapper.club|https://dev.poapper.club | ||
follow-redirect: true | ||
max-attempts: 3 | ||
retry-delay: 10s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM node:16.20-alpine AS builder | ||
|
||
WORKDIR /usr/src/app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm ci | ||
|
||
COPY . . | ||
COPY .env.production .env | ||
|
||
RUN npm run build | ||
|
||
# serving stage | ||
FROM nginx | ||
|
||
EXPOSE 80 | ||
|
||
COPY --from=builder /usr/src/app/public /usr/share/nginx/html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
version: '3.3' | ||
services: | ||
dev: | ||
image: 151345152001.dkr.ecr.ap-northeast-2.amazonaws.com/poapper-homepage:latest | ||
ports: | ||
- 9001:80 | ||
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-homepage:vX.X.X | ||
ports: | ||
- 9000:80 | ||
logging: | ||
driver: local | ||
options: | ||
max-size: 10m | ||
deploy: | ||
labels: | ||
swarmpit.service.deployment.autoredeploy: 'true' | ||
placement: | ||
constraints: | ||
- node.role != manager | ||
- node.labels.application == poapper_web |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
server { | ||
server_name dev.poapper.club; | ||
client_max_body_size 10M; | ||
|
||
location / { | ||
proxy_pass http://localhost:9001; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
server { | ||
server_name poapper.club; | ||
client_max_body_size 10M; | ||
|
||
location / { | ||
proxy_pass http://localhost:9000; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} |
Oops, something went wrong.