[Unit]
Description=ufmonitor apiserver
After=docker.service
Requires=docker.service

[Service]
TimeoutStartSec=0
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=-{{ ufmonitor_config_path }}
ExecStart=/usr/bin/docker run --detach --log-driver none --name %n -p 8000:8000 -e POSTGRES_DB_PASSWORD={{ ufmonitor_db_password }} --add-host=postgres:{{ ufmonitor_db_host }} {{ apiserver_container_image }}
ExecStop=/usr/bin/docker rm --force %n
TimeoutStopSec=180

[Install]
WantedBy=multi-user.target
