-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
56 lines (53 loc) · 1.24 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
version: '3'
services:
db:
build:
context: .
dockerfile: docker/db/Dockerfile
container_name: portfolio-db
volumes:
- database:/var/lib/postgresql/data
ports:
- 5432:5432
restart: always
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 'develop'
flask:
build:
context: .
dockerfile: docker/python/Dockerfile
container_name: portfolio-flask
tty: true
working_dir: /usr/src/app/
volumes:
- ./app:/usr/src/app/
- ./log/gunicorn.log:/var/log/flask/gunicorn.log
environment:
RDS_HOSTNAME: ${RDS_HOSTNAME}
RDS_PORT: ${RDS_PORT}
RDS_USERNAME: ${RDS_USERNAME}
RDS_PASSWORD: ${RDS_PASSWORD}
RDS_DB_NAME: ${RDS_DB_NAME}
FLASK_APP: 'application:app'
FLASK_CONFIG: ${FLASK_CONFIG}
restart: always
ports:
- 5000:5000
expose:
- 5000
command: /bin/sh -c "/usr/src/app/migrate.sh && gunicorn -c gunicorn_settings.py application:app"
depends_on:
- db
web:
image: nginx
container_name: portfolio-web
ports:
- 81:81
volumes:
- ./docker/web/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- flask
volumes:
database:
driver: local