-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
59 lines (55 loc) · 1.33 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
version: '3.8'
services:
db:
image: postgres:16
container_name: postgres_db
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- '5432:5432'
volumes:
- postgres_data:/var/lib/postgresql/data/
backend:
build: ./backend
container_name: django_backend
command: [ 'gunicorn', 'backend.wsgi:application', '--bind', '0.0.0.0:8000', '--timeout', '120' ]
ports:
- '8000:8000'
depends_on:
- db
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
SECRET_KEY: ${SECRET_KEY}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- ./backend:/app
- /app/venv
x-develop:
watch:
- action: sync
path: ./backend
target: /app
frontend:
build: ./frontend
container_name: react_frontend
ports:
- '3000:3000'
- '5001:5000'
volumes:
- ./frontend:/app
- /app/node_modules
depends_on:
- backend
environment:
VITE_API_URL: http://localhost:8000
x-develop:
watch:
- action: sync
path: ./frontend
target: /app
volumes:
postgres_data: