32 lines
795 B
INI
32 lines
795 B
INI
|
|
[Unit]
|
||
|
|
Description=Datahub PostgreSQL (TimescaleDB)
|
||
|
|
After=network-online.target
|
||
|
|
Requires=datahub-network.service
|
||
|
|
|
||
|
|
[Container]
|
||
|
|
ContainerName=datahub-postgres
|
||
|
|
Image=localhost/datahub-postgres:latest
|
||
|
|
Network=datahub.network
|
||
|
|
Volume=/var/container/data/datahub/postgres:/var/lib/postgresql/data:Z,U
|
||
|
|
PublishPort=127.0.0.1:5416:5432
|
||
|
|
|
||
|
|
Environment=POSTGRES_DB=datahub
|
||
|
|
Environment=POSTGRES_USER=datahub
|
||
|
|
Environment=POSTGRES_PASSWORD_FILE=/run/secrets/datahub-pg-password
|
||
|
|
Environment=TZ=Asia/Shanghai
|
||
|
|
Environment=PGDATA=/var/lib/postgresql/data/pgdata
|
||
|
|
|
||
|
|
Secret=datahub-pg-password,type=mount,target=datahub-pg-password,mode=0444
|
||
|
|
|
||
|
|
HealthCmd=pg_isready -U datahub -d datahub
|
||
|
|
HealthInterval=10s
|
||
|
|
HealthTimeout=5s
|
||
|
|
HealthRetries=10
|
||
|
|
|
||
|
|
[Service]
|
||
|
|
Restart=always
|
||
|
|
TimeoutStartSec=180
|
||
|
|
|
||
|
|
[Install]
|
||
|
|
WantedBy=default.target
|