ansible-edda/playbooks/roles/services/deploy/git/templates/systemd/pod-git-gitea.service

59 lines
2.6 KiB
Desktop File

[Unit]
Description=Podman pod-git-gitea.service
Documentation=man:podman-generate-systemd(1)
Wants=network.target
After=network-online.target
BindsTo=pod-git.service
After=pod-git.service
OnFailure=status-mail@%n.service
[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
Restart=on-failure
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/pod-git-gitea.pid %t/pod-git-gitea.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/pod-git-gitea.pid \
--cidfile %t/pod-git-gitea.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/pod-git.pod-id \
--replace \
--label "io.containers.autoupdate=image" \
--log-driver=journald \
-dt \
-v {{ system_etc_root_directory }}/resolv.conf:/etc/resolv.conf:ro \
-v ./.config/service/hosts:/etc/hosts:ro \
-v {{ services_data_directory }}/pod-git/data/_data:/data \
-v /etc/timezone:/etc/timezone:ro \
-v /etc/localtime:/etc/localtime:ro \
-e USER_UID="1000" \
-e USER_GID="1000" \
-e GITEA__database__DB_TYPE="postgres" \
-e GITEA__database__HOST="pod-database:5432" \
-e GITEA__database__NAME="{{ services[services_service_name].database.name }}" \
-e GITEA__database__USER="{{ services[services_service_name].database.user }}" \
-e GITEA__database__PASSWD="{{ services[services_service_name].database.password }}" \
-e GITEA__server__DOMAIN="{{ services[services_service_name].domain }}" \
-e GITEA__server__SSH_DOMAIN="{{ services[services_service_name].domain }}" \
-e GITEA__server__ROOT_URL="https://%(DOMAIN)s/" \
-e GITEA__server__START_SSH_SERVER="true" \
-e GITEA__server__SSH_PORT="{{ services[services_service_name].ssh_port }}" \
-e GITEA__server__SSH_LISTEN_PORT="{{ services[services_service_name].ssh_port }}" \
-e GITEA__mailer__ENABLED="true" \
-e GITEA__mailer__FROM="Gitea <noreply@{{ services[services_service_name].domain }}>" \
-e GITEA__mailer__MAILER_TYPE="smtp" \
-e GITEA__mailer__HOST="{{ services[services_service_name].smtp.host }}" \
-e GITEA__mailer__USER="{{ services[services_service_name].smtp.user }}" \
-e GITEA__mailer__PASSWD="{{ services[services_service_name].smtp.password }}" \
-e GITEA__service__DISABLE_REGISTRATION="true" \
-e GITEA__service__ENABLE_NOTIFY_MAIL="true" \
--name=pod-git-gitea \
docker.io/gitea/gitea:{{ services_service_deploy_versions.gitea }}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/pod-git-gitea.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/pod-git-gitea.ctr-id
PIDFile=%t/pod-git-gitea.pid
Type=forking
[Install]
WantedBy=multi-user.target default.target