Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RELEASE: ssl 인증서 자동 발급 설정 및 dev 서버 관련 파일 삭제, vercel 설정 파일 추가 #271

Open
wants to merge 7 commits into
base: release
Choose a base branch
from
4 changes: 2 additions & 2 deletions .github/workflows/CLIENT_BUILD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
username: ${{ secrets.RELEASE_USERNAME }}
password: ${{ secrets.RELEASE_PASSWORD }}
port: ${{ secrets.RELEASE_PORT }}
source: "docker-compose.production.yml"
source: "docker-compose.yml"
target: "oao"

- name: 운영 서버에서 Docker Compose 실행
Expand All @@ -100,7 +100,7 @@ jobs:

cd oao

docker-compose -f docker-compose.production.yml up -d
docker-compose -f docker-compose.yml up -d
docker image prune

- name: 실패시 슬랙 메시지 전송
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/CLIENT_DEV_BUILD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,32 +72,6 @@ jobs:
tags: ghcr.io/kumsil1006/oao-dev-client
context: ./client

- name: Docker Compose 파일 개발 서버로 복사
uses: appleboy/scp-action@master
with:
host: ${{ secrets.ANOTHER_HOST }}
username: ${{ secrets.ANOTHER_USERNAME }}
password: ${{ secrets.ANOTHER_PASSWORD }}
port: ${{ secrets.ANOTHER_PORT }}
source: "docker-compose.yml"
target: "oao"

- name: 개발 서버에서 Docker Compose 실행
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.ANOTHER_HOST }}
username: ${{ secrets.ANOTHER_USERNAME }}
password: ${{ secrets.ANOTHER_PASSWORD }}
port: ${{ secrets.ANOTHER_PORT }}
script: |
echo ${{secrets.CONTAINER_REGISTRY_TOKEN}} | docker login ghcr.io -u kumsil1006 --password-stdin
docker pull ghcr.io/kumsil1006/oao-dev-client

cd oao

docker-compose up -d
docker image prune

- name: 실패시 슬랙 메시지 전송
if: ${{ failure() }}
uses: ./.github/actions/slack-notify
Expand Down
18 changes: 5 additions & 13 deletions .github/workflows/PROXY_BUILD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- release
paths:
- "nginx/Dockerfile.production"
- "nginx/Dockerfile"

jobs:
proxy-build:
Expand All @@ -20,22 +20,14 @@ jobs:
username: kumsil1006
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Docker images build 및 GitHub Container Registry로 push
uses: docker/[email protected]
with:
push: true
tags: ghcr.io/kumsil1006/oao-proxy
context: ./nginx
file: ./nginx/Dockerfile.production

- name: Docker Compose 파일 운영 서버로 복사
uses: appleboy/scp-action@master
with:
host: ${{ secrets.RELEASE_HOST }}
username: ${{ secrets.RELEASE_USERNAME }}
password: ${{ secrets.RELEASE_PASSWORD }}
port: ${{ secrets.RELEASE_PORT }}
source: "docker-compose.production.yml"
source: "docker-compose.yml"
target: "oao"

- name: 운영 서버에서 Docker Compose 실행
Expand All @@ -48,10 +40,10 @@ jobs:
script: |
echo ${{secrets.CONTAINER_REGISTRY_TOKEN}} | docker login ghcr.io -u kumsil1006 --password-stdin
docker pull ghcr.io/kumsil1006/oao-proxy

cd oao
docker-compose -f docker-compose.production.yml up -d

docker-compose -f docker-compose.yml up -d
docker image prune

- name: 실패시 슬랙 메시지 전송
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/PROXY_DEV_BUILD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,32 +27,6 @@ jobs:
tags: ghcr.io/kumsil1006/oao-dev-proxy
context: ./nginx

- name: Docker Compose 파일 개발 서버로 복사
uses: appleboy/scp-action@master
with:
host: ${{ secrets.ANOTHER_HOST }}
username: ${{ secrets.ANOTHER_USERNAME }}
password: ${{ secrets.ANOTHER_PASSWORD }}
port: ${{ secrets.ANOTHER_PORT }}
source: "docker-compose.yml"
target: "oao"

- name: 개발 서버에서 Docker Compose 실행
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.ANOTHER_HOST }}
username: ${{ secrets.ANOTHER_USERNAME }}
password: ${{ secrets.ANOTHER_PASSWORD }}
port: ${{ secrets.ANOTHER_PORT }}
script: |
echo ${{secrets.CONTAINER_REGISTRY_TOKEN}} | docker login ghcr.io -u kumsil1006 --password-stdin
docker pull ghcr.io/kumsil1006/oao-dev-proxy

cd oao

docker-compose up -d
docker image prune

- name: 실패시 슬랙 메시지 전송
if: ${{ failure() }}
uses: ./.github/actions/slack-notify
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/SERVER_BUILD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
username: ${{ secrets.RELEASE_USERNAME }}
password: ${{ secrets.RELEASE_PASSWORD }}
port: ${{ secrets.RELEASE_PORT }}
source: "docker-compose.production.yml"
source: "docker-compose.yml"
target: "oao"

- name: 운영 서버에서 Docker Compose 실행
Expand All @@ -69,7 +69,7 @@ jobs:

cd oao

docker-compose -f docker-compose.production.yml up -d
docker-compose -f docker-compose.yml up -d
docker image prune

- name: 실패시 슬랙 메시지 전송
Expand Down
26 changes: 0 additions & 26 deletions .github/workflows/SERVER_DEV_BUILD.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,32 +40,6 @@ jobs:
push: true
tags: ghcr.io/kumsil1006/oao-dev-server

- name: Docker Compose 파일 개발 서버로 복사
uses: appleboy/scp-action@master
with:
host: ${{ secrets.ANOTHER_HOST }}
username: ${{ secrets.ANOTHER_USERNAME }}
password: ${{ secrets.ANOTHER_PASSWORD }}
port: ${{ secrets.ANOTHER_PORT }}
source: "docker-compose.yml"
target: "oao"

- name: 개발 서버에서 Docker Compose 실행
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.ANOTHER_HOST }}
username: ${{ secrets.ANOTHER_USERNAME }}
password: ${{ secrets.ANOTHER_PASSWORD }}
port: ${{ secrets.ANOTHER_PORT }}
script: |
echo ${{secrets.CONTAINER_REGISTRY_TOKEN}} | docker login ghcr.io -u kumsil1006 --password-stdin
docker pull ghcr.io/kumsil1006/oao-dev-server

cd oao

docker-compose up -d
docker image prune

- name: 실패시 슬랙 메시지 전송
if: ${{ failure() }}
uses: ./.github/actions/slack-notify
Expand Down
3 changes: 3 additions & 0 deletions client/vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"rewrites": [{ "source": "/(.*)", "destination": "/" }]
}
21 changes: 0 additions & 21 deletions docker-compose.production.yml

This file was deleted.

21 changes: 18 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,32 @@
version: "3.9"
services:
proxy:
image: "ghcr.io/kumsil1006/oao-dev-proxy:latest"
image: "nginx:latest"
ports:
- "80:80"
- "443:443"
restart: always
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
command: '/bin/sh -c ''while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g "daemon off;"'''

certbot:
image: "certbot/certbot"
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"

frontend:
image: "ghcr.io/kumsil1006/oao-dev-client:latest"
image: "ghcr.io/kumsil1006/oao-client:latest"
restart: always
expose:
- "3000"
backend:
image: "ghcr.io/kumsil1006/oao-dev-server:latest"
image: "ghcr.io/kumsil1006/oao-server:latest"
restart: always
expose:
- "8080"
4 changes: 0 additions & 4 deletions nginx/Dockerfile

This file was deleted.

4 changes: 0 additions & 4 deletions nginx/Dockerfile.production

This file was deleted.

18 changes: 18 additions & 0 deletions nginx/default.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
server {
listen 80;
server_name oneatonce.com;
server_tokens off;

location /.well-known/acme-challenge/ {
root /var/www/certbot;
}

}
server {
listen 443 ssl;
server_name oneatonce.com;
server_tokens off;

ssl_certificate /etc/letsencrypt/live/oneatonce.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/oneatonce.com/privkey.pem;
include /etc/letsencrypt/options-ssl-nginx.conf;
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem;

location / {
proxy_pass http://frontend:3000;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Expand Down
36 changes: 0 additions & 36 deletions nginx/default.production.conf

This file was deleted.

Loading