-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
96 lines (93 loc) · 2.14 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
version: '3'
services:
db:
container_name: postgres_database
image: postgres:13
ports:
# docker compose ищет эти переменные рядом с yml в .env
- "${POSTGRES_PORT}"
env_file:
- "config/.env"
volumes:
- "pgdata:/var/lib/postgresql/data"
restart: unless-stopped
networks:
- my_network
web:
container_name: django_webserver
build:
context: .
dockerfile: Dockerfile
expose:
- "${DB_EXPOSE}"
ports:
- "${DB_PORTS}"
volumes:
- .:/app
env_file:
- "config/.env"
depends_on:
- db
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER} -d ${DB_NAME}"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped
networks:
- my_network
nginx:
container_name: nginx_server
image: nginx:1.19.2
ports:
- "80:80"
volumes:
- "./src/nginx.conf:/etc/nginx/nginx.conf:ro"
- "./src/site.conf:/etc/nginx/conf.d/site.conf:ro"
- "static:/app/static"
- "media:/app/media"
depends_on:
- web
healthcheck:
test: ["CMD", "service", "nginx", "status"]
interval: 1m
timeout: 3s
retries: 3
restart: unless-stopped
networks:
- my_network
swagger:
container_name: swagger_ui
image: swaggerapi/swagger-ui:v5.6.2
ports:
- "8080:8080"
volumes:
- "./movies/api/openapi.yaml:/swagger.yaml"
environment:
- "SWAGGER_JSON=/swagger.yaml"
depends_on:
- nginx
networks:
- my_network
pgadmin:
container_name: database_pgadmin
image: dpage/pgadmin4
restart: unless-stopped
environment: # тут можно сделать отдельный pgadmin.env, но этот сервис в целом только на время разработки
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: root
ports:
- "5050:80"
volumes:
- "pgadmin-data:/var/lib/pgadmin"
depends_on:
- db
networks:
- my_network
networks:
my_network:
volumes:
pgdata:
static:
media:
pgadmin-data: