-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.dev.yml
69 lines (65 loc) · 1.54 KB
/
docker-compose.dev.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
version: '3.8'
services:
backend:
build: ./
user: root
volumes:
- ./:/app
ports:
- "8800:8800"
environment:
- ENVIRONMENT=dev
- TESTING=1
- DATABASE_URL=postgres://postgres:postgres@db:5432/backend_test
- BACKEND_PORT=8800
- TOPIC=humidity/outside
depends_on:
db:
condition: service_healthy
mosquitto:
condition: service_healthy
healthcheck:
test: curl --fail backend:8800/v1/health_check || exit 1
interval: 30s
retries: 5
start_period: 20s
timeout: 5s
restart: unless-stopped
db:
build:
context: ./src/database
dockerfile: Dockerfile
volumes:
- mqtt_fastapi_postgres_data:/var/lib/postgresql/data/
ports:
- "5454:5432"
expose:
- 5454
environment:
- PGUSER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: [ "CMD-SHELL", "pg_isready" ]
interval: 30s
retries: 5
start_period: 10s
timeout: 5s
restart: unless-stopped
mosquitto:
image: eclipse-mosquitto:latest
container_name: mosquitto
ports:
- "1883:1883"
volumes:
- ./mosquitto/config:/mosquitto/config
- ./mosquitto/data:/mosquitto/data
- ./mosquitto/log:/mosquitto/log
healthcheck:
test: [ "CMD-SHELL", "timeout 5 mosquitto_sub -t '$$SYS/#' -C 1 | grep -v Error || exit 1" ]
interval: 30s
retries: 5
start_period: 10s
timeout: 5s
restart: unless-stopped
volumes:
mqtt_fastapi_postgres_data: