-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (40 loc) · 1 KB
/
Copy pathdocker-compose.yml
File metadata and controls
44 lines (40 loc) · 1 KB
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
version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: knowledge-mysql
environment:
MYSQL_ROOT_PASSWORD: ltygxz712
MYSQL_DATABASE: bysj
MYSQL_CHARSET: utf8mb4
ports:
- "3306:3306"
volumes:
- mysql_data:/var/lib/mysql
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
backend:
build:
context: .
dockerfile: Dockerfile.backend
container_name: knowledge-backend
environment:
DATABASE_URL: mysql+pymysql://root:ltygxz712@mysql:3306/bysj?charset=utf8mb4
SECRET_KEY: your-production-secret-key-change-this
ports:
- "8000:8000"
depends_on:
- mysql
restart: unless-stopped
frontend:
image: nginx:alpine
container_name: knowledge-frontend
ports:
- "80:80"
volumes:
- ./frontend/dist:/usr/share/nginx/html:ro
- ./nginx.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- backend
restart: unless-stopped
volumes:
mysql_data: