-
Notifications
You must be signed in to change notification settings - Fork 12
/
docker-compose.yaml
59 lines (53 loc) · 1.38 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: '2'
services:
web:
restart: always
build: ./web
expose:
- "5000"
env_file: .env
command: /usr/local/bin/gunicorn -w 2 -b :5000 manage:app
links:
- postgres:postgres
- mailhog:mailhog
nginx:
restart: always
# build also includes static assets to be served by nginx
build: ./nginx
ports:
# You may be tempted to change this to 8080:80 locally, but limitations in Flask-Security will cause problems for you
- "80:80"
links:
- web:web
postgres:
restart: always
image: postgres:latest
ports:
- "5432:5432"
# the same env file defines both the postgres user/password
# so that postgres creates the user, and the app uses those creds
env_file: .env
volumes:
- pgdata:/var/lib/postgresql
db_migrate:
build: ./web
env_file: .env
links:
- postgres:postgres
volumes:
- ./web/migrations/versions:/usr/src/app/migrations/versions
command: python manage.py db migrate -m "description of schema changes"
psql:
image: postgres:latest
env_file: .env
links:
- postgres:postgres
# psql relies on env variable PGPASSWORD to bypass the usual password prompt
command: psql -h postgres -d $DB_NAME -U $DB_USER
mailhog:
image: mailhog/mailhog:latest
ports:
- "8025:8025"
- "1025:1025"
volumes:
pgdata: {}