[Unit]
Description=Gitea Server
Requires=gitea-db.service
After=gitea-db.service

[Container]
ContainerName=gitea-server
Image=docker.gitea.com/gitea:1.26.0
Network=gitea.network
PublishPort=3000:3000
PublishPort=2222:2222
Volume=/home/gitea/data/gitea:/data
Volume=/etc/timezone:/etc/timezone:ro
Volume=/etc/localtime:/etc/localtime:ro
Environment=USER_UID=1000
Environment=USER_GID=1000
Environment=GITEA__database__DB_TYPE=postgres
Environment=GITEA__database__HOST=gitea-db:5432
Environment=GITEA__database__NAME=gitea
Environment=GITEA__database__USER=gitea
Environment=GITEA__database__PASSWD={{ gitea_db_password }}
Environment=GITEA__server__SSH_LISTEN_PORT=2222
Environment=GITEA__server__SSH_PORT=2222
Environment=SSH_LISTEN_PORT=2222

[Service]
Restart=on-failure

[Install]
WantedBy=default.target