Skip to content

Commit

Permalink
refactor: 서버 이전
Browse files Browse the repository at this point in the history
  • Loading branch information
14hhan committed Dec 27, 2021
1 parent 1066271 commit 1d566d6
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
12 changes: 1 addition & 11 deletions config/nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,7 @@ upstream vote_mailedit {

server {

listen 443 ssl;

server_name vote-mailedit.kro.kr;

ssl_certificate /etc/nginx/ssl/vote-mailedit.kro.kr/fullchain1.pem;
ssl_certificate_key /etc/nginx/ssl/vote-mailedit.kro.kr/privkey1.pem;
listen 80;

location / {
proxy_pass http://vote_mailedit;
Expand All @@ -25,9 +20,4 @@ server {
location /media/ {
alias /home/app/web/media/;
}

location ~/.well-known/acme-challenge {
allow all;
root /var/www/certbot;
}
}
23 changes: 18 additions & 5 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
version: "3.8"
services:
db:
container_name: db
image: mariadb:latest
restart: always
environment:
MYSQL_ROOT_HOST: '%'
expose:
- 3306
ports:
- "3307:3306"
env_file:
- .env
volumes:
- dbdata:/var/lib/mysql

web:
container_name: web
build:
Expand All @@ -13,6 +28,8 @@ services:
volumes:
- static:/home/app/web/static
- media:/home/app/web/media
depends_on:
- db
expose:
- 8000
entrypoint:
Expand All @@ -23,18 +40,14 @@ services:
container_name: nginx
build: ./config/nginx
volumes:
- type: bind
source: /home/app/web/certbot/conf/archive
target: /etc/nginx/ssl
- /home/app/web/certbot/data:/var/www/certbot
- static:/home/app/web/static
- media:/home/app/web/media
ports:
- "80:80"
- "443:443"
depends_on:
- web

volumes:
static:
media:
dbdata:
3 changes: 3 additions & 0 deletions vote_mailedit/settings/prod.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
from .base import *
import pymysql

pymysql.install_as_MySQLdb()

DEBUG = False

Expand Down

0 comments on commit 1d566d6

Please sign in to comment.