-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
59 lines (58 loc) · 1.42 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
version: '3'
services:
sample-db:
container_name: sample-db
image: mysql:8
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
MYSQL_ROOT_PASSWORD: passw0rd
MYSQL_DATABASE: sample_db
MYSQL_USER: sample_user
MYSQL_PASSWORD: passw0rd
networks:
- sample-net
sample-api:
container_name: sample-api
build: .
environment:
- FLASK_ENV=development
volumes:
- .:/opt
command: ["/wait-for-it.sh", "-s", "-t", "60", "sample-db:3306", "--", "sh", "/opt/sample/bootstrap.sh"]
networks:
- sample-net
depends_on:
- sample-db
sample-ui:
container_name: sample-ui
build:
context: .
dockerfile: ./sample-ui/Dockerfile
volumes:
- .:/opt
command: ["/wait-for-it.sh", "-s", "-t", "600", "sample-api:5000", "--", "sh", "/opt/sample-ui/bootstrap.sh"]
networks:
- sample-net
depends_on:
- sample-api
sample-web:
container_name: sample-web
image: nginx
volumes:
- ./etc/nginx/sample.docker.template:/etc/nginx/conf.d/sample.docker.template
ports:
- "8090:80"
environment:
- NGINX_PORT=80
command: /bin/bash -c "envsubst < /etc/nginx/conf.d/sample.docker.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'"
networks:
- sample-net
depends_on:
- sample-api
- sample-ui
volumes:
db_data:
networks:
sample-net: