76 lines
2.5 KiB
YAML
76 lines
2.5 KiB
YAML
# Forgejo: the forge of the VPS, at ${FORGEJO_DOMAIN} (HTTPS through Caddy, git over SSH on 2222).
|
|
# Its repositories live in ${GIT_ROOT}/<owner>/<name>.git, where doco-cd reads them.
|
|
x-forgejo: &forgejo
|
|
image: forgejo-head:17.0.1
|
|
volumes:
|
|
# One volume: data and app.ini (owned by git in the image; an /etc/gitea volume would be root's).
|
|
- data:/var/lib/gitea
|
|
- ${GIT_ROOT}:/srv/git
|
|
environment: &env
|
|
GITEA_APP_INI: /var/lib/gitea/custom/conf/app.ini
|
|
FORGEJO__server__DOMAIN: ${FORGEJO_DOMAIN}
|
|
FORGEJO__server__ROOT_URL: https://${FORGEJO_DOMAIN}/
|
|
FORGEJO__server__HTTP_PORT: "3000"
|
|
FORGEJO__server__LANDING_PAGE: explore
|
|
FORGEJO__server__START_SSH_SERVER: "true"
|
|
FORGEJO__server__SSH_DOMAIN: ${FORGEJO_DOMAIN}
|
|
FORGEJO__server__SSH_PORT: "2222"
|
|
FORGEJO__server__SSH_LISTEN_PORT: "2222"
|
|
FORGEJO__database__DB_TYPE: sqlite3
|
|
FORGEJO__repository__ROOT: /srv/git
|
|
# Public to read, writable only by the hydrated admin (SSH keys from authorized_keys).
|
|
FORGEJO__repository__DEFAULT_PRIVATE: public
|
|
FORGEJO__repository__DISABLE_MIGRATIONS: "true"
|
|
FORGEJO__security__INSTALL_LOCK: "true"
|
|
FORGEJO__security__MIN_PASSWORD_LENGTH: "16"
|
|
FORGEJO__service__DISABLE_REGISTRATION: "true"
|
|
FORGEJO__service__REQUIRE_SIGNIN_VIEW: "false"
|
|
FORGEJO__service__DEFAULT_KEEP_EMAIL_PRIVATE: "true"
|
|
FORGEJO__openid__ENABLE_OPENID_SIGNIN: "false"
|
|
FORGEJO__openid__ENABLE_OPENID_SIGNUP: "false"
|
|
FORGEJO__mirror__ENABLED: "false"
|
|
FORGEJO__packages__ENABLED: "false"
|
|
FORGEJO__actions__ENABLED: "false"
|
|
FORGEJO__mailer__ENABLED: "false"
|
|
FORGEJO_ADMIN_USER: ${FORGEJO_ADMIN_USER}
|
|
FORGEJO_ADMIN_EMAIL: ${FORGEJO_ADMIN_EMAIL}
|
|
FORGEJO_ORG: ${FORGEJO_ORG}
|
|
FORGEJO_REPOS: ${FORGEJO_REPOS}
|
|
FORGEJO_REPOS_PRIVATE: ${FORGEJO_REPOS_PRIVATE}
|
|
|
|
services:
|
|
server:
|
|
<<: *forgejo
|
|
build: .
|
|
restart: unless-stopped
|
|
ports:
|
|
- "2222:2222"
|
|
networks:
|
|
- default
|
|
- caddy
|
|
labels:
|
|
caddy: ${FORGEJO_DOMAIN}
|
|
caddy.reverse_proxy: "{{upstreams 3000}}"
|
|
# The account, its SSH keys and its repositories, declared here (hydrate.sh), on every start.
|
|
secrets:
|
|
- age_key
|
|
post_start:
|
|
- command: ["/hydrate/hydrate.sh"]
|
|
user: root
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:3000/api/healthz"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
start_period: 30s
|
|
retries: 5
|
|
|
|
secrets:
|
|
age_key:
|
|
file: /etc/head-vps/age.key
|
|
|
|
networks:
|
|
caddy:
|
|
external: true
|
|
|
|
volumes:
|
|
data:
|