-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
81 lines (70 loc) · 2.13 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
# Docker Compose project for local development
name: park-api
# 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: park-api: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:
# 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:
postgresql:
condition: service_healthy
mysql:
condition: service_healthy
rabbitmq:
condition: service_healthy
# Define actual services (containers)
services:
flask:
<<: *flask-defaults
command: ["python3", "run-flask-dev.py"]
ports:
- '5000:5000'
worker:
<<: *flask-defaults
command: ["python3", "run-celery-dev.py"]
worker-heartbeat:
<<: *flask-defaults
command: ["python3", "run-celery-heartbeat-dev.py"]
flask-init-converters:
<<: *flask-defaults
command: ["flask", "source", "init-converters"]
postgresql:
image: postgis/postgis:15-3.4
volumes:
- postgresql:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=park-api
- POSTGRES_PASSWORD=development
- POSTGRES_DB=park-api
- PGUSER=park-api
healthcheck:
test: [ "CMD-SHELL", "sh -c 'pg_isready -U park-api -d park-api'" ]
interval: 10s
timeout: 3s
retries: 3
ports:
- "5432:5432"
rabbitmq:
image: rabbitmq:3.12
environment:
# Disable spammy logging
RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS: '-rabbit log [{console,[{level,warning}]}]'
RABBITMQ_ERLANG_COOKIE: dev-cookie
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 1s
timeout: 1s
retries: 20
volumes:
postgresql: