You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
950 B
42 lines
950 B
[Unit]
|
|
Description=PostgreSQL Database Server
|
|
Documentation=https://www.postgresql.org/
|
|
After=network.target
|
|
|
|
# Only start if Odoo has been configured
|
|
ConditionPathExists=/etc/containers/systemd/odoo/odoo-config.env
|
|
|
|
# Start/stop this unit when the target is started/stopped
|
|
PartOf=odoo.target
|
|
|
|
[Container]
|
|
ContainerName=odoo-db
|
|
Image=docker.io/library/postgres:17-alpine
|
|
|
|
# Network configuration
|
|
Network=host
|
|
|
|
# Environment variables from config
|
|
EnvironmentFile=/etc/containers/systemd/odoo/odoo-db.env
|
|
|
|
# Volume mounts
|
|
Volume=/var/lib/postgresql/data-odoo:/var/lib/postgresql/data:Z
|
|
|
|
# Health check
|
|
HealthCmd=pg_isready -U odoo -d postgres -p 5433
|
|
HealthInterval=30s
|
|
HealthTimeout=10s
|
|
HealthStartPeriod=60s
|
|
HealthRetries=3
|
|
|
|
[Service]
|
|
Restart=always
|
|
RestartSec=10
|
|
TimeoutStartSec=120
|
|
TimeoutStopSec=30
|
|
|
|
# Skaffold filesystem + fix permissions
|
|
ExecStartPre=install -m 0700 -o 70 -g 70 -d /var/lib/postgresql/data-odoo
|
|
|
|
[Install]
|
|
WantedBy=odoo.target
|
|
|