-
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.
Merge pull request #14 from NewWays-TechForImpactKAIST/feat/deploy-do…
…cker
- Loading branch information
Showing
13 changed files
with
203 additions
and
4 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 @@ | ||
/node_modules | ||
/dist | ||
.env | ||
.env.test | ||
.env.production | ||
.env.development | ||
.DS_store | ||
*.code-workspace | ||
*.swp | ||
/logs/*.log |
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 |
---|---|---|
@@ -1 +1,5 @@ | ||
MONGO_CONNECTION_URI=mongodb://localhost:27017 | ||
# required environment variables | ||
MONGO_CONNECTION_URI=mongodb://localhost:27017/council | ||
|
||
# optional environment variables | ||
PORT=2300 |
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,39 @@ | ||
--- | ||
name: Bug report | ||
about: 버그 세부 사항을 입력해 주세요. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## 버그 설명 | ||
버그가 무엇인지 명확하고 간결하게 설명합니다. | ||
|
||
## 재현 방법 | ||
버그를 재현하는 단계를 설명해 주세요: | ||
1. '...'로 이동 | ||
2. '....'를 클릭 | ||
3. '....'까지 아래로 스크롤 | ||
4. 오류 발생 | ||
|
||
## 예상된 결과 | ||
정상적인 경우 예상되는 상황에 대해 명확하고 간결하게 설명합니다. | ||
|
||
## 스크린샷 | ||
해당되는 경우 문제를 설명하는 데 도움이 되는 스크린샷을 추가하세요. | ||
|
||
## 문제 발생 환경 | ||
**데스크탑 (다음 정보를 입력해 주세요):** | ||
- OS: [e.g. iOS] | ||
- 브라우저 [e.g. chrome, safari] | ||
- 버전 [e.g. 22] | ||
|
||
**모바일 (다음 정보를 입력해 주세요):** | ||
- 기기명: [e.g. iPhone6] | ||
- OS: [e.g. iOS8.1] | ||
- 브라우저 [e.g. chrome, safari] | ||
- 버전 [e.g. 22] | ||
|
||
## 추가 정보 | ||
문제에 대한 추가적인 정보가 있다면 입력해 주세요. |
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 @@ | ||
--- | ||
name: Custom issue template | ||
about: Describe this issue template's purpose here. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
|
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 @@ | ||
--- | ||
name: Feature request | ||
about: Feature 작업 사항을 입력해 주세요. | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## 문제 상황 | ||
해결하려는 문제가 있다면 무엇인지 명확하고 간결하게 설명합니다. (ex. [...] 가 안 돼서 짜증나요!) | ||
|
||
## 해결 방안 제안 | ||
해결하려는 방법을 명확하고 간결하게 설명합니다. | ||
|
||
## 고려한 다른 대안들 | ||
고려해 본 다른 대안이나 기능에 대해 명확하고 간결하게 설명합니다. | ||
|
||
## 추가 정보 | ||
여기에 기능 요청에 대한 다른 상황이나 스크린샷을 추가하세요. |
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,52 @@ | ||
name: Push Dev Image to GitHub Packages on Pushes to Main | ||
|
||
# when tagging action success | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- main | ||
|
||
jobs: | ||
if_merged: | ||
if: github.event.pull_request.merged == true | ||
name: Build and Push | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- 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 Packages | ||
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u USERNAME --password-stdin | ||
|
||
- name: Build Image and Push to GitHub Packages | ||
id: build_image_and_push | ||
uses: docker/build-push-action@v5 | ||
env: | ||
IMAGE_TAG: dev | ||
with: | ||
push: true | ||
tags: | | ||
"ghcr.io/NewWays-TechForImpactKAIST/backend:${{ 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,24 @@ | ||
FROM node:18-alpine | ||
|
||
WORKDIR /usr/src/app | ||
|
||
# Install curl(for debugging purpose) and pnpm | ||
RUN apk update && apk add curl && npm install --global [email protected] | ||
|
||
# pnpm fetch does require only lockfile | ||
COPY pnpm-lock.yaml . | ||
|
||
# Note: devDependencies are fetched | ||
RUN pnpm fetch | ||
|
||
# Copy repository and install dependencies | ||
ADD . ./ | ||
RUN pnpm install --offline | ||
|
||
# Build | ||
RUN pnpm build | ||
|
||
# Run container | ||
EXPOSE 80 | ||
ENV PORT 80 | ||
CMD ["pnpm", "prod"] |
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 @@ | ||
version: "3.8" | ||
services: | ||
newways-backend: | ||
container_name: newways-backend | ||
image: "ghcr.io/NewWays-TechForImpactKAIST/backend:dev" | ||
ports: | ||
- "${PORT:?}:80" | ||
environment: | ||
- MONGO_CONNECTION_URI=${MONGO_CONNECTION_URI:?} | ||
watchtower: | ||
container_name: newways-watchtower | ||
image: "containrrr/watchtower:latest" | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
command: --interval 60 --cleanup newways-backend |
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 @@ | ||
version: "3.8" | ||
services: | ||
newways-backend: | ||
container_name: newways-backend | ||
image: "ghcr.io/NewWays-TechForImpactKAIST/backend:latest" | ||
ports: | ||
- "${PORT:?}:80" | ||
environment: | ||
- MONGO_CONNECTION_URI=${MONGO_CONNECTION_URI:?} | ||
watchtower: | ||
container_name: newways-watchtower | ||
image: "containrrr/watchtower:latest" | ||
volumes: | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
command: --interval 60 --cleanup newways-backend |
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,7 @@ | ||
{ | ||
"ignore": ["node_modules/*"], | ||
"env": { | ||
"TZ": "Asia/Seoul", | ||
"NODE_ENV": "development" | ||
} | ||
} |
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
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
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