coreos-home-server/config/service/nginx/nginx-static@.service
Alex Palaistras d9f675817e First public release for CoreOS Home Server
This contains the culmination of work done privately for a few months,
and is intended to be a solid basis for other peoples' experimentations
with setting up single-node, home-server setups using Fedora CoreOS.
2021-03-20 16:32:42 +00:00

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