-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from sparcs-kaist/release/0.1.3
- Loading branch information
Showing
86 changed files
with
8,343 additions
and
4,640 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,2 @@ | ||
MONGO_PORT= | ||
REDIS_PORT= |
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,13 @@ | ||
#Dotenv file needed for `docker-compose` | ||
SSO_CLIENT_ID= | ||
SSO_SECRET= | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
SESSION_SECRET= | ||
JWT_SECRET= | ||
S3_BUCKET= | ||
SLACK_WEBHOOK_URL= | ||
SERVER_PORT= | ||
AWS_S3_DUMP_BUCKET_NAME= | ||
AWS_S3_DUMP_BUCKET_ACCESS_KEY_ID= | ||
AWS_S3_DUMP_BUCKET_SECRET_ACCESS_KEY= |
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,15 @@ | ||
FROM node:16-alpine | ||
|
||
|
||
RUN apk add --no-cache git | ||
|
||
WORKDIR '/app' | ||
|
||
COPY ./package.json ./ | ||
COPY ./yarn.lock ./ | ||
RUN yarn | ||
|
||
COPY . . | ||
|
||
EXPOSE 80 | ||
ENTRYPOINT [ "yarn", "start" ] |
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,13 @@ | ||
FROM node:16.19.1 | ||
|
||
RUN apt update | ||
|
||
RUN apt install git -y | ||
|
||
WORKDIR /app | ||
|
||
EXPOSE 6001 | ||
|
||
VOLUME [ "/app" ] | ||
|
||
CMD ["yarn", "dev"] |
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,20 @@ | ||
services: | ||
mongo: | ||
container_name: zabo-mongo-dev | ||
extends: | ||
file: ./docker-compose.yml | ||
service: zabo-mongo | ||
restart: unless-stopped | ||
ports: | ||
- ${MONGO_PORT:-27017}:27017 | ||
redis: | ||
container_name: zabo-redis-dev | ||
extends: | ||
file: ./docker-compose.yml | ||
service: zabo-redis | ||
restart: unless-stopped | ||
ports: | ||
- ${REDIS_PORT:-6379}:6379 | ||
|
||
volumes: | ||
zabo-mongo-data: |
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,63 @@ | ||
version: "3" | ||
|
||
services: | ||
zabo-server: | ||
container_name: zabo-server | ||
restart: always | ||
image: ghcr.io/sparcs-kaist/zabo-server:dev | ||
ports: | ||
- "${SERVER_PORT}:6001" | ||
depends_on: | ||
- zabo-mongo | ||
- zabo-redis | ||
volumes: | ||
- zabo-server-log:/app/log | ||
environment: | ||
- NODE_ENV=${NODE_ENV:-production} | ||
- MINIMUM_LOG_LEVEL=info | ||
- SSO_CLIENT_ID=${SSO_CLIENT_ID} | ||
- SSO_SECRET=${SSO_SECRET} | ||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} | ||
- SESSION_SECRET=${SESSION_SECRET} | ||
- JWT_SECRET=${JWT_SECRET} | ||
- S3_BUCKET=${S3_BUCKET} | ||
- MONGODB_URL=mongodb://zabo-mongo:27017/zabo | ||
- REDIS_URL=redis://zabo-redis:6379 | ||
- SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} | ||
|
||
zabo-mongo: | ||
container_name: zabo-mongo | ||
restart: always | ||
image: mongo:4.4 | ||
volumes: | ||
- zabo-mongo-data:/data/db | ||
|
||
zabo-redis: | ||
container_name: zabo-redis | ||
restart: always | ||
image: redis:7.0.4-alpine | ||
|
||
zabo-scheduler: | ||
container_name: zabo-scheduler | ||
restart: always | ||
build: | ||
context: .. | ||
dockerfile: .scheduler/Dockerfile | ||
environment: | ||
- AWS_ACCESS_KEY_ID=${AWS_S3_DUMP_BUCKET_ACCESS_KEY_ID} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_S3_DUMP_BUCKET_SECRET_ACCESS_KEY} | ||
- BUCKET=${AWS_S3_DUMP_BUCKET_NAME} | ||
- BACKUP_FOLDER=mongodb-dump/ | ||
- MONGODB_HOST=zabo-mongo:27017 | ||
- DB_STR=zabo | ||
volumes: | ||
- zabo-scheduler-log:/backup_log:rw | ||
|
||
volumes: | ||
zabo-server-log: | ||
external: true | ||
zabo-mongo-data: | ||
external: true | ||
zabo-scheduler-log: | ||
external: true |
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,63 @@ | ||
version: "3" | ||
|
||
services: | ||
zabo-server: | ||
container_name: zabo-server | ||
restart: always | ||
image: ghcr.io/sparcs-kaist/zabo-server:latest | ||
ports: | ||
- "${SERVER_PORT}:6001" | ||
depends_on: | ||
- zabo-mongo | ||
- zabo-redis | ||
volumes: | ||
- zabo-server-log:/app/log | ||
environment: | ||
- NODE_ENV=${NODE_ENV:-production} | ||
- MINIMUM_LOG_LEVEL=info | ||
- SSO_CLIENT_ID=${SSO_CLIENT_ID} | ||
- SSO_SECRET=${SSO_SECRET} | ||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} | ||
- SESSION_SECRET=${SESSION_SECRET} | ||
- JWT_SECRET=${JWT_SECRET} | ||
- S3_BUCKET=${S3_BUCKET} | ||
- MONGODB_URL=mongodb://zabo-mongo:27017/zabo | ||
- REDIS_URL=redis://zabo-redis:6379 | ||
- SLACK_WEBHOOK_URL=${SLACK_WEBHOOK_URL} | ||
|
||
zabo-mongo: | ||
container_name: zabo-mongo | ||
restart: always | ||
image: mongo:4.4 | ||
volumes: | ||
- zabo-mongo-data:/data/db | ||
|
||
zabo-redis: | ||
container_name: zabo-redis | ||
restart: always | ||
image: redis:7.0.4-alpine | ||
|
||
zabo-scheduler: | ||
container_name: zabo-scheduler | ||
restart: always | ||
build: | ||
context: .. | ||
dockerfile: .scheduler/Dockerfile | ||
environment: | ||
- AWS_ACCESS_KEY_ID=${AWS_S3_DUMP_BUCKET_ACCESS_KEY_ID} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_S3_DUMP_BUCKET_SECRET_ACCESS_KEY} | ||
- BUCKET=${AWS_S3_DUMP_BUCKET_NAME} | ||
- BACKUP_FOLDER=mongodb-dump/ | ||
- MONGODB_HOST=zabo-mongo:27017 | ||
- DB_STR=zabo | ||
volumes: | ||
- zabo-scheduler-log:/backup_log:rw | ||
|
||
volumes: | ||
zabo-server-log: | ||
external: true | ||
zabo-mongo-data: | ||
external: true | ||
zabo-scheduler-log: | ||
external: true |
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,9 @@ | ||
.idea | ||
.git | ||
.gitignore | ||
.dockerignore | ||
.docker/Dockerfile | ||
*.md | ||
*.sh | ||
*.yml | ||
node_modules |
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 @@ | ||
{ | ||
"extends": [ | ||
"airbnb-base", | ||
"prettier" | ||
], | ||
"rules": { | ||
"import/no-unresolved": 0, | ||
"import/prefer-default-export": 0, | ||
"import/no-import-module-exports": 0, | ||
"no-nested-ternary": "off", | ||
"no-unused-vars": "warn", | ||
"no-unused-expressions": "warn", | ||
"no-spaced-func": "off", | ||
"no-underscore-dangle": "off", | ||
"no-shadow": "warn", | ||
"prefer-const": "warn", | ||
"consistent-return": [ | ||
"warn", | ||
{ | ||
"treatUndefinedAsUnspecified": true | ||
} | ||
], | ||
"no-await-in-loop": "warn" | ||
}, | ||
"parserOptions": { | ||
"ecmaVersion": 2020 | ||
}, | ||
"env": { | ||
"browser": false, | ||
"node": true | ||
} | ||
} |
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,31 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: "[Bug] Bug title" | ||
labels: bug | ||
assignees: '' | ||
|
||
--- | ||
|
||
# Describe the bug | ||
|
||
<!-- 버그가 발생한 상황을 간결하고 명확하게 설명해주세요. 버그가 발생한 원인을 추측하실 수 있다면, 같이 써주셔도 좋습니다. --> | ||
|
||
A clear and concise description of what the bug is. | ||
|
||
# To Reproduce | ||
|
||
<!-- 버그를 재현할 수 있는 과정을 단계별로 설명해주세요. --> | ||
|
||
Steps to reproduce the behavior: | ||
|
||
1. Go to '...' | ||
2. Click on '....' | ||
3. Scroll down to '....' | ||
4. See error | ||
|
||
# Screenshots | ||
|
||
<!-- 스크린샷이나 영상이 버그 설명에 도움이 된다면, 함께 첨부해주시면 감사하겠습니다. --> | ||
|
||
If applicable, add screenshots to help explain your problem. |
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,18 @@ | ||
--- | ||
name: Issue template | ||
about: Suggest an idea for this project | ||
title: Issue | ||
labels: enhancement | ||
assignees: '' | ||
|
||
--- | ||
|
||
# Summary <!-- 이슈에 대한 간단한 요약. --> | ||
|
||
It implements ... | ||
|
||
# Tasks <!-- 해야 할 태스크 체크리스트로 만들기 --> | ||
|
||
- [ ] Task 1 | ||
- [ ] Task 2 | ||
- [ ] Task 3 |
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 @@ | ||
# Summary <!-- PR 내용에 대한 간단한 요약 및 닫는 이슈 번호 표기. --> | ||
|
||
It closes #issue_number | ||
|
||
# Extra info <!-- Answer 'y' or 'n'. 필요하지 않으면 지우셔도 됩니다. --> | ||
|
||
# Images or Screenshots <!-- PR 변경 사항에 대한 Screenshot이나 .gif 파일 --> | ||
|
||
# Further Work <!-- PR 이후 개설할 이슈 목록 --> | ||
|
||
- Do something... |
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,37 @@ | ||
name: Build docker image on push to develop | ||
|
||
on: | ||
push: | ||
branches: ["develop"] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-buildx-${{ github.sha }} | ||
restore-keys: | | ||
${{ runner.os }}-buildx- | ||
- name: Log in to GitHub Container Registry | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin | ||
- name: Build and push Image | ||
id: docker-build | ||
uses: docker/build-push-action@v5 | ||
env: | ||
IMAGE_TAG: dev | ||
with: | ||
file: ./.docker/Dockerfile | ||
push: true | ||
tags: "ghcr.io/sparcs-kaist/zabo-server:${{ env.IMAGE_TAG }}" | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
- name: Remove old cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
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 @@ | ||
name: Deploy to dev server | ||
|
||
# when dev image build action is completed, run this action | ||
on: | ||
workflow_run: | ||
workflows: ["Build docker image on push to develop"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
if_workflow_success: | ||
name: Deploy to dev server | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
|
||
steps: | ||
- name: pull the image and restart the container | ||
uses: appleboy/ssh-action@v1.0.0 | ||
with: | ||
host: ${{ secrets.DEV_HOST }} | ||
port: ${{ secrets.DEV_PORT }} | ||
username: ${{ secrets.DEV_USERNAME }} | ||
password: ${{ secrets.DEV_PASSWORD }} | ||
proxy_host: ${{ secrets.DEV_PROXY_HOST }} | ||
proxy_port: ${{ secrets.DEV_PROXY_PORT }} | ||
proxy_username: ${{ secrets.DEV_PROXY_USERNAME }} | ||
proxy_password: ${{ secrets.DEV_PROXY_PASSWORD }} | ||
script_stop: true # stop script if any command has failed | ||
script: | | ||
cd ${{ secrets.DEV_WORKING_DIRECTORY }} | ||
docker compose -f .docker/docker-compose.stage.yml -p zabo --env-file=.docker/.env.prod pull | ||
docker compose -f .docker/docker-compose.stage.yml -p zabo --env-file=.docker/.env.prod up --force-recreate --build -d |
Oops, something went wrong.