forked from konstantin-ukolov/docker_homework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker_compose.yaml
64 lines (59 loc) · 1.2 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
version: '3'
services:
front:
image: frontend
container_name: front
hostname: front
restart: "unless-stopped"
build:
context: .
dockerfile: Dockerfile-multistage
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost"]
interval: 30s
timeout: 10s
retries: 5
ports:
- 8085:80
networks:
- frontend_net
back:
image: backend
container_name: back
hostname: back
restart: "unless-stopped"
build:
context: .
dockerfile: Dockerfile-backend
ports:
- 8000:8000
networks:
- backend_net
depends_on:
- database
database:
image: postgres:14-alpine
container_name: database
hostname: database
restart: "unless-stopped"
environment:
- POSTGRES_USER=django
- POSTGRES_PASSWORD=django
- POSTGRES_DB=django
- PGDATA=/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U django"]
interval: 10s
timeout: 10s
retries: 5
volumes:
- postgres:/var/lib/postgresql/data
networks:
- backend_net
networks:
frontend_net:
driver: bridge
backend_net:
driver: bridge
volumes:
postgres: