-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
68 lines (66 loc) · 1.61 KB
/
docker-compose.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
version: '2'
services:
django:
restart: unless-stopped
build:
dockerfile: ./docker/backend/Dockerfile
context: .
image: django:latest
container_name: django
env_file:
- .env
# ports:
# - "8000:8000"
command: >
bash -c "python manage.py collectstatic --noinput && python manage.py migrate && gunicorn -b 0.0.0.0:8000 backend.wsgi:application"
volumes:
- ./media:/backend/media:consistent
- ./static:/backend/static:consistent
- ./backend/backend/settings.py:/backend/backend/settings.py:consistent
depends_on:
- postgres
postgres:
restart: unless-stopped
image: postgres:15
container_name: postgres
volumes:
- ~/.pg/pg_data/todo-react-django:/var/lib/postgresql/data
env_file:
- .env
ports:
- "5432:5432"
adminer:
image: adminer
restart: always
ports:
- '1000:8080'
depends_on:
- postgres
nginx:
restart: unless-stopped
build:
dockerfile: ./Dockerfile
context: ./docker/nginx/
container_name: nginx_backend
image: nginx_backend
volumes:
- ./static:/backend/static:consistent
- ./media:/backend/media:consistent
- /var/run/docker.sock:/tmp/docker.sock:ro
depends_on:
- django
env_file:
- .env
ports:
- "${NGINX_EXTERNAL_PORT:-80}:80"
frontend:
build:
dockerfile: ./docker/frontend/Dockerfile
context: .
container_name: vite-react-express
command: npm run serve
image: vite-react-express:latest
ports:
- '3000:3000'
volumes:
- ./frontend:/frontend