entrance
Ansible role that deploys my edge device with connectivity containers. Currently it deploys a thread border router via the zbt-1 dongle by Home Assistant, a zigbee2MQTT interface using the Sonoff zigbee dongle and a DSMR reader with a generic P1 to USB converter.
1.1 KB•J2
dsmr-reader-docker-compose.yml.j2
1.1 KB • 42 lines • plaintext
1services:
2 dsmrdb:
3 image: postgres:15
4 container_name: dsmrdb
5 ports:
6 - 5432:5432
7 environment:
8 POSTGRES_USER: {{ dsmr_pg_user }}
9 POSTGRES_PASSWORD: {{ dsmr_pg_password }}
10 POSTGRES_DB: {{ dsmr_pg_db }}
11 volumes:
12 - ./data/dsmrdb:/var/lib/postgresql/data
13 - ./backups:/backups
14 healthcheck:
15 test: ["CMD-SHELL", "PGPASSWORD={{ dsmr_pg_password }} pg_isready -U {{ dsmr_pg_user }} -d {{ dsmr_pg_db }}"]
16 interval: 10s
17 timeout: 5s
18 retries: 5
19 start_period: 60s
20 restart: unless-stopped
21
22 dsmr:
23 image: ghcr.io/xirixiz/dsmr-reader-docker:latest
24 container_name: dsmr-reader
25 depends_on:
26 dsmrdb:
27 condition: service_healthy
28 ports:
29 - "{{ dsmr_web_port }}:80"
30 env_file:
31 - .env
32 devices:
33 - "{{ device_paths.p1 }}:/dev/ttyUSB0"
34 healthcheck:
35 test: ["CMD", "curl", "-Lsf", "http://127.0.0.1/about", "-o", "/dev/null", "-w", "HTTP_%{http_code}"]
36 interval: 30s
37 timeout: 10s
38 retries: 3
39 start_period: 120s
40 restart: unless-stopped
41
42