-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
65 lines (59 loc) · 1.74 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
# This is a Docker Compose file that sets up three services: flask-database, wsgi-server, and proxy-server.
# The flask-database service uses a custom postgres image, has resources limits and reservations set, and has environment
# variables set for the Postgres user, password, and database name.
# The wsgi-server service uses a custom gunicorn image and has resources limits and reservations set. It also depends
# on the flask-database service.
# The proxy-server service uses a custom nginx image, has resources limits and reservations set, and exposes port 80.
# It also depends on the wsgi-server service.
# The file also sets up a volume named postgres_data.
version: '3.7'
services:
flask-database:
container_name: postgres-database
image: jakubszuber/custom-postgres
deploy:
resources:
limits:
cpus: '0.50'
memory: 128M
reservations:
cpus: '0.25'
memory: 64M
environment:
- POSTGRES_USER=admin
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=flask_db
volumes:
- postgres_data:/var/lib/postgresql/data
wsgi-server:
container_name: gunicorn-server
image: jakubszuber/custom-gunicorn
deploy:
resources:
limits:
cpus: '0.50'
memory: 256M
reservations:
cpus: '0.25'
memory: 128M
restart: always
depends_on:
- flask-database
proxy-server:
container_name: nginx-server
image: jakubszuber/custom-nginx
deploy:
resources:
limits:
cpus: '0.50'
memory: 32M
reservations:
cpus: '0.25'
memory: 16M
restart: always
ports:
- "80:80"
depends_on:
- wsgi-server
volumes:
postgres_data: {}