forked from netology-code/shvirtd-example-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompose.yaml
More file actions
48 lines (44 loc) · 1001 Bytes
/
compose.yaml
File metadata and controls
48 lines (44 loc) · 1001 Bytes
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
include:
- ./proxy.yaml
services:
web:
depends_on:
db:
condition: service_healthy
image: shvirtd-example-python:0.0.1
build:
context: .
dockerfile: Dockerfile.python
restart: on-failure
networks:
backend:
ipv4_address: 172.20.0.5
ports:
- 5000
environment:
- DB_HOST=db
- DB_USER=${MYSQL_USER}
- DB_PASSWORD=${MYSQL_PASSWORD}
- DB_NAME=${MYSQL_DATABASE}
db:
image: mysql:8
restart: on-failure
volumes:
- db_data:/var/lib/mysql
networks:
backend:
ipv4_address: 172.20.0.10
ports:
- 3306
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_HOST="%"
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
volumes:
db_data: {}