mirror of
https://github.com/deuill/coreos-home-server.git
synced 2024-09-21 21:50:46 +00:00
Alex Palaistras
aafa8d9f12
This will help make subsequent synchronization with hosts easier, as systemd files and potential dropins are guarnateed to exist under a certain hierarchy that can be dropped as-is into host configuration directories.
23 lines
839 B
Desktop File
23 lines
839 B
Desktop File
[Unit]
|
|
Description=Nginx static web service for %I
|
|
Wants=container-build@%i.service container-network@ingress.service
|
|
After=container-build@%i.service container-network@ingress.service
|
|
Before=nginx-ingress-http@%i.service
|
|
|
|
[Service]
|
|
Restart=always
|
|
PrivateTmp=true
|
|
Environment=SERVER_NAME=%i
|
|
Environment=NGINX_CONF=/etc/container-service/nginx/service/%p.conf.template
|
|
ExecStartPre=/bin/install -d /tmp/conf.d
|
|
ExecStartPre=/bin/sh -c "envsubst '$SERVER_NAME' < ${NGINX_CONF} > /tmp/conf.d/%i.conf"
|
|
ExecStartPre=/bin/podman create --replace --pull never --net ingress \
|
|
--volume /tmp/conf.d:/etc/nginx/conf.d:z \
|
|
--name %i localhost/%i:latest
|
|
ExecStart=/bin/podman start --attach %i
|
|
ExecStop=/bin/podman stop --time 10 %i
|
|
|
|
[Install]
|
|
Alias=%i.service
|
|
WantedBy=multi-user.target
|