-
Notifications
You must be signed in to change notification settings - Fork 43
/
docker-compose.yml
59 lines (53 loc) · 1.46 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
# --------------------------------------------------------------------------
# When 'docker-compose up --build' is run, this file is executed.
#
# Its purpose is to run 3 containers (nginx, flask and postgres) and
# attach them together in a common network with shared volumes.
# --------------------------------------------------------------------------
version: '3'
services:
postgres:
build: ./postgres
container_name: postgres
ports:
- 2345:5432
networks:
- net
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- postgres:/var/lib/postgresql/data
flask:
build: ./flask
container_name: flask
volumes:
- ./flask:/usr/src/app
networks:
- net
environment:
- APP_SETTINGS=config.DevelopmentConfig
- DATABASE_URL=postgresql://postgres:postgres@postgres:5432/db_dev
- DATABASE_TEST_URL=postgresql://postgres:postgres@postgres:5432/db_test
- SECRET_KEY=dockertutorial
depends_on:
- postgres
links:
- postgres
command: gunicorn --worker-class eventlet -w 4 -b 0.0.0.0:8000 manage:app
nginx:
build: ./nginx
container_name: nginx
ports:
- 80:80
restart: always
networks:
- net
volumes:
- ./flask/project/static:/usr/share/nginx/html/static
depends_on:
- flask
volumes:
postgres:
networks:
net: