-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
67 lines (61 loc) · 1.36 KB
/
docker-compose.yaml
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
version: "3.9"
services:
db:
image: postgres:14-alpine
env_file: .env
container_name: ${POSTGRES_HOST}
hostname: ${POSTGRES_HOST}
volumes:
- data_db:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_DB=${POSTGRES_DB}
ports:
- "5433:5432"
networks:
- stocksbrm-network
api:
build: ./stocks_brm-api/
container_name: api
env_file: .env
command: >
sh -c "python manage.py runserver 0.0.0.0:8005"
environment:
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
- POSTGRES_DB=${POSTGRES_DB}
volumes:
- ./stocks_brm-api/:/usr/src/app/
links:
- db:db
ports:
- "8005:8005"
networks:
- stocksbrm-network
depends_on:
- db
restart: on-failure
front:
build: ./stocks_brm-front/
container_name: front
command: >
sh -c "python manage.py runserver 0.0.0.0:8000"
volumes:
- ./stocks_brm-front/:/usr/src/app/
ports:
- "8000:8000"
links:
- api:api
networks:
- stocksbrm-network
depends_on:
- api
restart: on-failure
volumes:
data_db:
networks:
stocksbrm-network:
driver: bridge