-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
61 lines (54 loc) · 1.32 KB
/
docker-compose.yml
File metadata and controls
61 lines (54 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
services:
### DATABASE (mysql)
db:
image: mysql:8.0
env_file:
- .env
volumes:
- mysql_data:/var/lib/mysql
- ./database/init.sql:/docker-entrypoint-initdb.d/init.sql
- ./database/perm.sql:/docker-entrypoint-initdb.d/perm.sql
healthcheck:
test: ["CMD-SHELL", "mysqladmin ping -h db -u root --password=$MYSQL_ROOT_PASSWORD || exit 1"]
interval: 25s
timeout: 70s
retries: 1500
### BACKEND (django)
backend:
build:
context: ./backend
dockerfile: Dockerfile
command: >
sh -c "python manage.py makemigrations &&
python manage.py migrate &&
gunicorn --bind 0.0.0.0:8000 --workers 3 backend.wsgi:application"
volumes:
- ./backend:/app
working_dir: /app
ports:
- "8000:8000"
depends_on:
db:
condition: service_healthy
### FRONTEND (nextjs)
frontend_nextjs:
build:
context: ./frontend_nextjs
dockerfile: Dockerfile
environment:
- NODE_ENV=production
volumes:
- ./frontend_nextjs:/app
### PORT FORWARDING (nginx)
nginx:
image: nginx:latest
container_name: nginx
depends_on:
- frontend_nextjs
ports:
- "80:80"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
# Storing data persistently
volumes:
mysql_data: