-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (91 loc) · 2.96 KB
/
docker-compose.yml
File metadata and controls
103 lines (91 loc) · 2.96 KB
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
# 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:
OCPDB_POSTGRES_DB: ocpdb
OCPDB_POSTGRES_USER: ocpdb
OCPDB_POSTGRES_PASSWORD: development
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:
rabbitmq:
condition: service_healthy
postgre:
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"]
worker:
<<: *flask-defaults
command: ["python3", "run_celery_dev.py"]
worker-heartbeat:
<<: *flask-defaults
command: ["python3", "run_celery_heartbeat_dev.py"]
postgre:
image: postgis/postgis:15-3.5-alpine
environment:
- POSTGRES_USER=ocpdb
- POSTGRES_PASSWORD=development
- POSTGRES_DB=ocpdb
- PGUSER=ocpdb
healthcheck:
test: [ "CMD-SHELL", "sh -c 'pg_isready -U ocpdb -d ocpdb'" ]
interval: 10s
timeout: 3s
retries: 3
regionalschluessel-importer:
image: ghcr.io/osgeo/gdal:alpine-small-3.12.1
user: *local-user
volumes:
- ./scripts:/scripts
- ./data/regionalschluessel:/data
environment:
- VG25_GEOPACKAGE_URL=${VG25_GEOPACKAGE_URL:-https://mobidata-bw.de/daten/ipl/verwaltungsgrenzen/DE_VG25.gpkg}
- VG25_GEOPACKAGE_WGET_USER_AGENT='OCPDB development'
- PGHOST=postgre
- PGUSER=ocpdb
- PGPASSWORD=development
- PGDATABASE=ocpdb
depends_on:
postgre:
condition: service_healthy
command: ["/scripts/import-regionalschluessel.sh"]
rabbitmq:
image: rabbitmq:latest
user: rabbitmq
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