Keep the pre-move Gitea in .deprecated/gitea as the rollback
The old stpvm service is kept as a compose override with its state mounts pointed at .deprecated/gitea/, where the pre-move data now lives (gitignored), so rolling back is one layered 'up' rather than a revert. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
# =============================================================================
|
||||
# .deprecated/gitea/docker-compose.gitea.yml — Gitea as it ran on stpvm until
|
||||
# 2026-11-24, kept as the rollback from the move to its own LXC.
|
||||
#
|
||||
# STATUS: not live. Gitea runs on stpgit (gitea/docker-compose.yml); stpvm's
|
||||
# `gitea` service is an haproxy forwarder to it.
|
||||
#
|
||||
# This is the old service verbatim except for the two state mounts, which now
|
||||
# point at the pre-move copy moved in beside this file (gitignored). Layered
|
||||
# over docker-compose.yml it replaces the forwarder under the same name;
|
||||
# compose merges the forwarder's GITEA_UPSTREAM and haproxy.cfg mount in
|
||||
# too, and both are harmless to Gitea. Relative paths resolve against the
|
||||
# project directory (the repo root), not this file. See README.md here and
|
||||
# DEPLOYMENT.md §7, "Gitea LXC", for the full rollback.
|
||||
# =============================================================================
|
||||
services:
|
||||
# Self-hosted git, served at /gitea/ and on port 3000 directly. Also the CI
|
||||
# server: .gitea/workflows/deploy.yaml redeploys this whole stack on push to
|
||||
# main, executed by the act_runner that lives outside docker (gitea-runner/).
|
||||
#
|
||||
# ROOTLESS image: runs as an unprivileged user, so config lives in /etc/gitea
|
||||
# and data in /var/lib/gitea (not /data as in the root image) — that is why
|
||||
# the bind mounts look unlike most Gitea compose examples.
|
||||
#
|
||||
# The GITEA__section__KEY environment convention is Gitea's own: each maps to
|
||||
# an app.ini key and overrides the file at runtime, which is how the secrets
|
||||
# stay in .env instead of in the committed app.ini.template.
|
||||
#
|
||||
# entrypoint is overridden to run our wrapper (which materialises app.ini
|
||||
# from the template on first boot) before handing off to Gitea's real
|
||||
# docker-entrypoint.sh. dumb-init is kept as PID 1 for correct signal/zombie
|
||||
# handling, exactly as the stock image does it.
|
||||
gitea:
|
||||
image: docker.gitea.com/gitea:1.25.4-rootless
|
||||
container_name: "${GITEA_HOST}"
|
||||
entrypoint: ["/usr/bin/dumb-init", "--", "/etc/gitea/entrypoint.sh"]
|
||||
networks:
|
||||
- app-network
|
||||
environment:
|
||||
- GITEA__database__DB_TYPE=postgres
|
||||
- GITEA__database__HOST=${POSTGRES_HOST}
|
||||
- GITEA__database__NAME=${POSTGRES_GITEA_DB}
|
||||
- GITEA__database__USER=${POSTGRES_USER}
|
||||
- GITEA__database__PASSWD=${POSTGRES_PASSWORD}
|
||||
- GITEA__server__LFS_JWT_SECRET=${GITEA_LFS_JWT_SECRET}
|
||||
- GITEA__security__INTERNAL_TOKEN=${GITEA_INTERNAL_TOKEN}
|
||||
- GITEA__oauth2__JWT_SECRET=${GITEA_OAUTH2_JWT_SECRET}
|
||||
# The host's own name, which Gitea prints in SSH clone URLs. It lives in
|
||||
# .env, not app.ini, so moving to another host is a one-line change;
|
||||
# environment-to-ini writes it into the live app.ini on every start.
|
||||
# localhost suits dev.
|
||||
- GITEA__server__SSH_DOMAIN=${GITEA_SSH_DOMAIN:-localhost}
|
||||
- GITEA__server__DOMAIN=${GITEA_SSH_DOMAIN:-localhost}
|
||||
# Webhooks are refused to private addresses by default ("external").
|
||||
# The usaco site's push hook targets http://usaco:8080 on the Docker
|
||||
# network, so that one host is allowed by name.
|
||||
- GITEA__webhook__ALLOWED_HOST_LIST=external,usaco
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
restart: always
|
||||
volumes:
|
||||
# PERSISTENT: repositories, LFS objects, avatars, sessions. The git data
|
||||
# itself. (Gitea's *relational* data is in Postgres, not here.)
|
||||
- ./.deprecated/gitea/data:/var/lib/gitea
|
||||
# PERSISTENT: app.ini is generated into this host directory on first boot
|
||||
# and then edited by Gitea itself, so it is gitignored — only the
|
||||
# template is committed.
|
||||
- ./.deprecated/gitea/config:/etc/gitea
|
||||
# Mounted over the config dir so the wrapper script is available at the
|
||||
# path the overridden entrypoint points at.
|
||||
- ./gitea/entrypoint.sh:/etc/gitea/entrypoint.sh:ro
|
||||
# Match the Pi's clock/zone so commit and CI timestamps are local time.
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
# 2222 = Gitea's *built-in* SSH server (the rootless image cannot use 22).
|
||||
# Clones use ssh://git@host:2222/... — including the deploy workflow,
|
||||
# which fetches from ssh://git@localhost:2222.
|
||||
- "2222:2222"
|
||||
# 3000 = HTTP, published directly as well as proxied at /gitea/, because
|
||||
# the act_runner registers against http://localhost:3000 from the host.
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
- db
|
||||
Reference in New Issue
Block a user