-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.prod.yml
96 lines (88 loc) · 2.43 KB
/
docker-compose.prod.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: "3.8"
services:
frontend: #프론트 엔드 서비스를 만듬
build:
context: ../frontend #프론트 엔드 소스코드는 이 경로에 있다.
dockerfile: ../frontend/Dockerfile #빌드할때 프론트엔드 도커파일을 사용함.
args:
API_URL: "*"
container_name: frontend
volumes:
- ./frontend:/frontend
- build_folder:/frontend/dist
- ./frontend/node_modules:/frontend/node_modules
image: run
tty: true
nginx:
build:
context: nginx
container_name: nginx
restart: unless-stopped
ports:
- "80:80"
# - "443:443"
volumes:
- build_folder:/var/www/frontend
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf
# - ./certbot/conf:/etc/letsencrypt:rw
# - ./certbot/www:/var/www/certbot:rw
depends_on:
- frontend
expose:
- '80'
# - '443'
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
# networks:
# - app-tier
# mysqldb:
# image: mysql:8.0
# container_name: mysqldb
# env_file:
# - "./backend/db/.env"
# ports:
# - "3306:3306"
# platform: linux/amd64
# volumes:
# - ./elk/logs/mysql_data:/var/var/log
# - ./backend/db/init/:/docker-entrypoint-initdb.d/
# - ./backend/db/init.sql:/docker-entrypoint-initdb.d/init.sql
# healthcheck:
# test: ["CMD", "mysqladmin", "ping", "-h", "mysqldb"]
# timeout: 20s
# retries: 10
# command: ["--general-log", "--general-log-file=/var/log/mysql.log"]
backend:
build:
context: ../backend
container_name: backend
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
daphne -b 0.0.0.0 -p 8000 config.asgi:application"
ports:
- "8000:8000"
# volumes:
## - static_volume:/backend/staticfiles
## - media_volume:/backend/mediafiles
# - build_folder:/var/www/frontend
expose:
- "8000"
# networks:
restart: always
tty: true
# depends_on:
# - mysqldb
#
#
#
# certbot:
# image: certbot/certbot
# restart: unless-stopped
# volumes:
# - ./certbot/conf:/etc/letsencrypt:rw
# - ./certbot/www:/var/www/certbot:rw
# entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
# depends_on:
# - nginx
volumes:
build_folder: {}