-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.haproxy.yml
109 lines (109 loc) · 2.96 KB
/
docker-compose.haproxy.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
97
98
99
100
101
102
103
104
105
106
107
108
109
version: '3'
services:
proxy:
image: haproxy
ports:
- "8080:80"
volumes:
- ./haproxy_conf/:/usr/local/etc/haproxy
depends_on:
- web1
- web2
- web3
# True static content needs to be separated out in a logical manner:
# js, images, and if there are any true static HTML files. Routes
# in the app need to accomodate the separation too
# TODO https://www.nginx.com/resources/admin-guide/reverse-proxy/
web1:
image: lifeloop-nginx
build:
dockerfile: Dockerfile.nginx
context: .
environment:
- PROXY_HOST=flask1
volumes:
- ./nginx_conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx_conf/entrypoint.sh:/nginx/entrypoint.sh
- ./nginx_conf/sites-available:/etc/nginx/sites-available
- ./lifeloopweb/templates:/usr/share/nginx/html
- ./lifeloopweb/static:/usr/share/nginx/static/
depends_on:
- flask1
web2:
image: lifeloop-nginx
build:
dockerfile: Dockerfile.nginx
context: .
environment:
- PROXY_HOST=flask2
volumes:
- ./nginx_conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx_conf/entrypoint.sh:/nginx/entrypoint.sh
- ./nginx_conf/sites-available:/etc/nginx/sites-available
- ./lifeloopweb/templates:/usr/share/nginx/html
- ./lifeloopweb/static:/usr/share/nginx/static/
depends_on:
- flask2
web3:
image: lifeloop-nginx
build:
dockerfile: Dockerfile.nginx
context: .
environment:
- PROXY_HOST=flask3
volumes:
- ./nginx_conf/nginx.conf:/etc/nginx/nginx.conf
- ./nginx_conf/entrypoint.sh:/nginx/entrypoint.sh
- ./nginx_conf/sites-available:/etc/nginx/sites-available
- ./lifeloopweb/templates:/usr/share/nginx/html
- ./lifeloopweb/static:/usr/share/nginx/static/
depends_on:
- flask3
flask1:
image: lifeloopweb
build: .
env_file: .env
environment:
- FLASK_APP=lifeloopweb/lifeloopweb_app.py
- FLASK_DEBUG=1
volumes:
- .:/code
depends_on:
- database
command: dockerize -timeout 60s -wait tcp://database:3306 flask run -h 0.0.0.0 -p5000 --reload
flask2:
image: lifeloopweb
build: .
env_file: .env
environment:
- FLASK_APP=lifeloopweb/lifeloopweb_app.py
- FLASK_DEBUG=1
volumes:
- .:/code
depends_on:
- database
command: dockerize -timeout 60s -wait tcp://database:3306 flask run -h 0.0.0.0 -p5000 --reload
flask3:
image: lifeloopweb
build: .
env_file: .env
environment:
- FLASK_APP=lifeloopweb/lifeloopweb_app.py
- FLASK_DEBUG=1
volumes:
- .:/code
depends_on:
- database
command: dockerize -timeout 60s -wait tcp://database:3306 flask run -h 0.0.0.0 -p5000 --reload
database:
image: percona
volumes:
- ./database_data:/var/lib/mysql
ports:
- "3306:3306"
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=1
mailhog:
image: mailhog/mailhog
ports:
- "8025:8025"