Add compose example with database.
This commit is contained in:
commit
da357f01ff
1 changed files with 41 additions and 0 deletions
41
docker/compose.with-database.yml
Normal file
41
docker/compose.with-database.yml
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
version: '3.8'
|
||||||
|
services:
|
||||||
|
timescaledb:
|
||||||
|
image: timescale/timescaledb:latest-pg15
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: ${PG_USER}
|
||||||
|
POSTGRES_PASSWORD: ${PG_PASSWORD}
|
||||||
|
POSTGRES_DB: ${PG_DB}
|
||||||
|
ports:
|
||||||
|
- "5432:5432"
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
volumes:
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
- /opt/opendtu-logger/database:/var/lib/postgresql/data
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U ${PG_USER}"]
|
||||||
|
interval: 5s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 20
|
||||||
|
|
||||||
|
opendtu-logger:
|
||||||
|
image: git.hollander.online/energy/opendtu-logger:main
|
||||||
|
environment:
|
||||||
|
DB_URL: ${DB_URL}
|
||||||
|
REMOTE_URL: ${REMOTE_URL}
|
||||||
|
TIMESCALEDB_ENABLED: ${TIMESCALEDB_ENABLED}
|
||||||
|
TZ: ${TZ}
|
||||||
|
depends_on:
|
||||||
|
timescaledb:
|
||||||
|
condition: service_healthy
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
volumes:
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
|
||||||
|
networks:
|
||||||
|
internal:
|
||||||
|
attachable: true
|
Loading…
Reference in a new issue