-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdocker-compose.yml
176 lines (162 loc) · 4.63 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
version: "3.9"
# Use --profile full-dev and uncomment RATELIMIT_STORAGE_URI to use redis
services:
db:
container_name: dds_database
image: mariadb:10.11.5
environment:
- MYSQL_ROOT_PASSWORD=${DDS_MYSQL_ROOT_PASS}
- MYSQL_USER=${DDS_MYSQL_USER}
- MYSQL_PASSWORD=${DDS_MYSQL_PASS}
- MYSQL_DATABASE=DeliverySystem
restart: on-failure
ports:
- 127.0.0.1:3306:3306
# Test to see if the database is accessible.
# Backend waits for this with 'condition: service_healthy'
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
interval: 10s
timeout: 5s
retries: 5
# volumes:
# # Config for encryption
# - type: bind
# source: ./Dockerfiles/mariadb/mariadb.conf
# target: /etc/mysql/conf.d/encrypt.cnf
# # Keys
# - type: bind
# source: ./Dockerfiles/mariadb/db-encrypt
# target: /etc/mysql/encrypt
# Development service to watch for
# changes to SCSS files and recompile static CSS
node_builder:
container_name: dds_nodebuilder
build:
dockerfile: Dockerfiles/nodebuilder.Dockerfile
context: ./
volumes:
- type: bind
source: ./dds_web/static/
target: /build
backend:
container_name: dds_backend
image: dds-backend-local:latest
# This user will be used by default in the container.
# When we want to run as root, change the following line
# user: "root:root"
user: "1001:1001"
build:
dockerfile: Dockerfiles/backend.Dockerfile
context: ./
target: base
working_dir: /code
command: sh -c "flask db upgrade && flask init-db $$DB_TYPE && flask run -h 0.0.0.0 -p 5000"
environment:
- DDS_VERSION=local-dev
- DDS_APP_CONFIG=/code/dds_web/sensitive/dds_app.cfg
- FLASK_DEBUG=true
- FLASK_APP=dds_web
- FLASK_INSTANCE_NAME=LOCAL_DEVELOPMENT
- DB_TYPE=${DDS_DB_TYPE}
# - RATELIMIT_STORAGE_URI=redis://dds_redis
depends_on:
db:
condition: service_healthy
restart: on-failure
ports:
- 127.0.0.1:5000:5000
volumes:
# Migrations
- type: bind
source: ./migrations
target: /code/migrations
# Main website files (so can edit locally)
- type: bind
source: ./dds_web
target: /code/dds_web
# Tests directory (so can edit locally)
- type: bind
source: ./tests
target: /code/tests
# Sensitive config file: dds_app.cfg
- type: bind
source: $DDS_SENSITIVE_FILES
target: /code/dds_web/sensitive
# Logging outputs
- type: bind
source: $DDS_LOG_DIR
target: /dds_web/logs
minio:
container_name: dds_minio
image: minio/minio:RELEASE.2022-02-24T22-12-01Z
profiles:
- s3
- full-dev
- cli
command: server /data --console-address ":9001"
ports:
- 127.0.0.1:9000:9000
- 127.0.0.1:9001:9001
environment:
MINIO_ROOT_USER: minio # access key
MINIO_ROOT_PASSWORD: minioPassword # secret key
# NOTE: Uncomment if you want to keep your data.
# Mounts a folder into the container to make uploaded data persistent.
# volumes:
# - type: bind
# source: ./minio-data
# target: /data
minio2: # Added in order to be able to test the new sto4 move
container_name: dds_minio_2
image: minio/minio:RELEASE.2022-02-24T22-12-01Z
profiles:
- s3
- full-dev
- cli
command: server /data --console-address ":9003"
ports:
- 127.0.0.1:9002:9000
- 127.0.0.1:9003:9003
environment:
MINIO_ROOT_USER: minio2 # access key
MINIO_ROOT_PASSWORD: minioPassword2 # secret key
# NOTE: Uncomment if you want to keep your data.
# Mounts a folder into the container to make uploaded data persistent.
# volumes:
# - type: bind
# source: ./minio-data
# target: /data
mailcatcher:
container_name: dds_mailcatcher
image: sj26/mailcatcher:latest
profiles:
- dev
- mail
- full-dev
- cli
ports:
- 127.0.0.1:1080:1080
redis:
container_name: dds_redis
image: redis:latest
profiles:
- full-dev
- redis
cli:
container_name: dds_cli
command: sh -c "pip install --upgrade -e . && tail -f /dev/null"
build:
dockerfile: Dockerfiles/cli.Dockerfile
context: ./
target: base
profiles:
- cli
- full-dev
environment:
- DDS_CLI_ENV=docker-dev
volumes:
- type: bind
source: ../dds_cli
target: /code