forked from netology-code/shvirtd-example-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
46 lines (41 loc) · 897 Bytes
/
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
version: '3.8'
include:
- proxy.yaml
x-restat: &restart
restart: on-failure
services:
web:
build:
context: .
dockerfile: Dockerfile.python
<<: [*restart]
networks:
backend:
ipv4_address: 172.20.0.5
ports:
- "5000:5000"
environment:
DB_HOST: db
DB_USER: ${MYSQL_USER}
DB_PASSWORD: ${MYSQL_PASSWORD}
DB_NAME: ${MYSQL_DATABASE}
db:
image: mysql:8
<<: [*restart]
networks:
backend:
ipv4_address: 172.20.0.10
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- MYSQL_DATABASE=${MYSQL_DATABASE}
- MYSQL_USER=${MYSQL_USER}
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
- MYSQL_ROOT_HOST=%
networks:
backend:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/24