-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
156 lines (134 loc) · 3.9 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
# Docker Compose project for local development
name: ocpdb
# binary butterfly GmbH projects add a project specific modifier to standard ports to prevent port collisions.
# This project has the modified +10.
# Define placeholder for running a container with the same UID/GID as your local user
x-local-user: &local-user ${DOCKER_LOCAL_USER:?Variable needs to be set in .env (e.g. "DOCKER_LOCAL_USER=1000:1000")}
# Define common defaults to reuse them in the service definitions (YAML anchors)
x-flask-defaults: &flask-defaults
image: ocpdb-flask:local-dev
build:
context: .
dockerfile: Dockerfile.dev
volumes:
- .:/app
environment:
# Set this variable in .env to start the app with a different config file (default: config.yaml)
CONFIG_FILE:
# TODO: This should be removed at some point and the app should be made SQLAlchemy 2.0 compatible!
SQLALCHEMY_SILENCE_UBER_WARNING: 1
OCPDB_POSTGRES_DB: ocpdb
OCPDB_POSTGRES_USER: ocpdb
OCPDB_POSTGRES_PASSWORD: admin
OCPDB_POSTGRES_DOCKER_COMPOSE_SERVICE: postgre
# The containers should run with the same UID/GID as your local user, so that files created by the containers are
# owned by and accessible to the local user.
user: *local-user
depends_on:
mysql:
condition: service_healthy
rabbitmq:
condition: service_healthy
# Define reusable defaults for mocked services
x-mocked-service-defaults: &mocked-service-defaults
image: ocpdb-flask:local-dev
command: ["python", "/app/app.py"]
user: *local-user
services:
flask:
<<: *flask-defaults
command: ["python3", "run_flask_dev.py"]
ports:
- '5010:5000'
worker:
<<: *flask-defaults
command: ["python3", "run_celery_dev.py"]
worker-heartbeat:
<<: *flask-defaults
command: ["python3", "run_celery_heartbeat_dev.py"]
mysql:
image: mariadb
volumes:
- .:/app
- mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ocpdb
healthcheck:
test: mariadb -h mysql -P 3306 -u root -p$$MYSQL_ROOT_PASSWORD -e "SELECT 1"
interval: 1s
timeout: 1s
retries: 20
postgre:
image: postgis/postgis
volumes:
- postgres:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=ocpdb
- POSTGRES_PASSWORD=admin
- POSTGRES_DB=ocpdb
- PGUSER=ocpdb
healthcheck:
test: [ "CMD-SHELL", "sh -c 'pg_isready -U ocpdb -d ocpdb'" ]
interval: 10s
timeout: 3s
retries: 3
phpmyadmin:
image: phpmyadmin/phpmyadmin
ports:
- '8091:80'
environment:
PMA_USER: root
PMA_PASSWORD: root
PMA_HOST: mysql
UPLOAD_LIMIT: 512M
# Disable spammy logging
APACHE_LOG_DIR: /tmp/logs
pgadmin:
image: dpage/pgadmin4
ports:
- '8092:80'
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DISABLE_POSTFIX: 1
PGADMIN_DEFAULT_PASSWORD: admin
rabbitmq:
image: rabbitmq:latest
environment:
# Disable spammy logging
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: '-rabbit log [{console,[{level,warning}]}]'
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 1s
timeout: 1s
retries: 20
redis:
image: redis:7.2
healthcheck:
test: redis-cli ping
interval: 1s
timeout: 1s
retries: 20
mocked-ochp:
<<: *mocked-service-defaults
volumes:
- ./dev/test_services/mocked_ochp:/app
mocked-chargeit:
<<: *mocked-service-defaults
volumes:
- ./dev/test_services/mocked_chargeit:/app
mocked-stadtnavi:
<<: *mocked-service-defaults
volumes:
- ./dev/test_services/mocked_stadtnavi:/app
mocked-sw-stuttgart:
<<: *mocked-service-defaults
volumes:
- ./dev/test_services/mocked_sw_stuttgart:/app
mocked-giroe:
<<: *mocked-service-defaults
volumes:
- ./dev/test_services/mocked_giroe:/app
volumes:
mysql:
postgres: