-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yml
62 lines (58 loc) · 1.3 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
version: "3.7"
services:
backend:
build:
context: ./django_backend
dockerfile: Dockerfile
volumes:
- django_static_volume:/usr/src/app/static
- django_media_volume:/usr/src/app/media
hostname: backend
expose:
- 8000
command: ./entrypoint.sh
links:
- database
database:
image: postgres:13-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
restart: 'always'
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- 5432:5432
frontend:
build:
context: ./react_frontend
dockerfile: Dockerfile
args:
- API_SERVER=${ENV_API_SERVER}
volumes:
- react_static_volume:/usr/src/app/build/static
hostname: frontend
expose:
- 3000
env_file:
- .env
command: serve -s build -l 3000
links:
- backend
nginx:
restart: always
build: ./nginx
volumes:
- django_static_volume:/usr/src/app/django_files/static
- django_media_volume:/usr/src/app/media
- react_static_volume:/usr/src/app/react_files/static
ports:
- 80:80
links:
- frontend
volumes:
postgres_data:
django_static_volume:
django_media_volume:
react_static_volume: