-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (59 loc) · 1.32 KB
/
docker-compose.yml
File metadata and controls
63 lines (59 loc) · 1.32 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
services:
db:
image: mysql:8.0
container_name: switchbot-mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: switchbot_db
MYSQL_USER: switchbot_user
MYSQL_PASSWORD: switchbot_pass
volumes:
- db_data:/var/lib/mysql
ports:
- "3306:3306"
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: switchbot-backend
ports:
- "8000:8000"
environment:
- DJANGO_PRODUCTION=true
- CORS_ALLOWED_ORIGINS=http://frontend:3000
- DB_ENGINE=django.db.backends.mysql
- DB_NAME=switchbot_db
- DB_USER=switchbot_user
- DB_PASSWORD=switchbot_pass
- DB_HOST=db
- DB_PORT=3306
depends_on:
- db
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
args:
NEXT_PUBLIC_API_BASE_URL: ""
container_name: switchbot-frontend
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- NEXT_PUBLIC_API_BASE_URL=
nginx:
build:
context: ./nginx
dockerfile: Dockerfile
container_name: switchbot-nginx
ports:
- "80:80"
environment:
- FRONTEND_URL=http://frontend:3000
- BACKEND_URL=http://backend:8000
depends_on:
- backend
- frontend
volumes:
db_data: