-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
63 lines (60 loc) · 1.86 KB
/
Copy pathdocker-compose.yml
File metadata and controls
63 lines (60 loc) · 1.86 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
# Local dev broker for PIMA (Fase 3). TimescaleDB + ingestion service arrive in Fase 4.
# Mosquitto 2.x requires an explicit listener + auth (anonymous defaults to false
# once a listener is declared). The password file must exist before first boot —
# see mosquitto/README.md for the one-time bootstrap.
services:
mosquitto:
image: eclipse-mosquitto:2
container_name: pima-mosquitto
restart: unless-stopped
ports:
- "1883:1883"
volumes:
- ./mosquitto/config:/mosquitto/config
- mosquitto-data:/mosquitto/data
- mosquitto-log:/mosquitto/log
healthcheck:
# Probe authenticates with a dedicated 'health' user (anonymous is disabled).
test: ["CMD-SHELL", "mosquitto_sub -h 127.0.0.1 -p 1883 -u health -P health -t '$$SYS/broker/uptime' -C 1 -W 3 || exit 1"]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
timescaledb:
image: timescale/timescaledb:latest-pg16
container_name: pima-tsdb
restart: unless-stopped
environment:
POSTGRES_USER: pima
POSTGRES_PASSWORD: pima
POSTGRES_DB: pima
ports:
- "5432:5432"
volumes:
- tsdb-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U pima -d pima"]
interval: 10s
timeout: 5s
retries: 5
backend:
build:
context: .
dockerfile: backend/Dockerfile
container_name: pima-backend
restart: unless-stopped
# Broker creds come from .env (the operator's broker by default). To use the
# local mosquitto instead, set PIMA_MQTT_HOST=mosquitto in .env (+ bootstrap).
env_file:
- .env
environment:
PIMA_DATABASE_URL: postgresql://pima:pima@timescaledb:5432/pima
depends_on:
timescaledb:
condition: service_healthy
ports:
- "8000:8000"
volumes:
mosquitto-data:
mosquitto-log:
tsdb-data: