-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
106 lines (79 loc) · 2.2 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
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
# User/password credentials are stored in .env file
services:
mongo:
image: mongo:4.4
expose:
- 27017
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGODB_ROOT_USER}
MONGO_INITDB_ROOT_PASSWORD: ${MONGODB_ROOT_PASS}
MONGO_INITDB_DATABASE: 'smarter'
HOME: /home/mongodb
MONGODB_SMARTER_USER: ${MONGODB_SMARTER_USER}
MONGODB_SMARTER_PASS: ${MONGODB_SMARTER_PASS}
# The entrypoint of the image is created to pass its arguments along to mongod
command: --wiredTigerCacheSizeGB 1
# to export volume, as recommeded in https://registry.hub.docker.com/u/library/mysql/
volumes:
- type: bind
source: ./mongodb-data
target: /data/db
- type: bind
source: ./mongodb-home
target: /home/mongodb
- type: bind
source: ./docker-entrypoint-initdb.d
target: /docker-entrypoint-initdb.d
networks:
- default
uwsgi:
# a custom image for flask
build:
# required to include poetry stuff into uwsgi image
context: .
dockerfile: uwsgi/Dockerfile
environment:
PYTHONPATH: "/var/uwsgi/smarter/"
# You can pass multiple environment variables from an external file through
# to a service’s containers with the ‘env_file’ option
env_file:
- .env
# exec a different command from image
command: uwsgi --ini /var/uwsgi/smarter_uwsgi.ini --memory-report
# set working dir for uwsgi
working_dir: /var/uwsgi/smarter/
# define volumes
volumes:
- type: bind
source: ./flask-data/
target: /var/uwsgi/
# required by coveralls
- type: bind
source: ./.git/
target: /var/uwsgi/.git/
read_only: true
# Expose the default port
# link container to database
links:
- mongo
networks:
- default
nginx:
# a custom image for NGINX
build: ./nginx
volumes:
- type: bind
source: ./nginx/conf.d/
target: /etc/nginx/conf.d/
- type: bind
source: ./flask-data/
target: /var/uwsgi/
ports:
- "27080:80"
# link container uwsgi
links:
- uwsgi
networks:
- default
networks:
default: