# Gitea Docker Compose — rendered by phase1_gitea_unraid.sh and phase2_gitea_fedora.sh # Variables: GITEA_VERSION, DATA_PATH, GITEA_CONTAINER_IP, GITEA_NETWORK_NAME # DATA_PATH is host-specific (UNRAID_GITEA_DATA_PATH or FEDORA_GITEA_DATA_PATH) # DB_SERVICE block is stripped for sqlite3, kept for mysql/postgres/mssql. # INTERNAL_NET blocks are also stripped for sqlite3 (no DB = no internal network). version: "3" services: # DB_SERVICE_START db: image: ${DB_DOCKER_IMAGE} container_name: gitea-db restart: unless-stopped environment: ${DB_ENV_VARS} volumes: - ${DATA_PATH}/db:/var/lib/${DB_DATA_DIR} healthcheck: test: ${DB_HEALTHCHECK} interval: 10s timeout: 5s retries: 5 networks: - gitea-internal # DB_SERVICE_END gitea: image: gitea/gitea:${GITEA_VERSION} container_name: gitea restart: unless-stopped # DB_DEPENDS_START depends_on: db: condition: service_healthy # DB_DEPENDS_END environment: - USER_UID=1000 - USER_GID=1000 volumes: - ${DATA_PATH}/data:/data # Gitea repositories, LFS, avatars, etc. - ${DATA_PATH}/config:/data/gitea/conf # app.ini lives here - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro networks: ${GITEA_NETWORK_NAME}: ipv4_address: ${GITEA_CONTAINER_IP} # INTERNAL_NET_REF_START gitea-internal: # INTERNAL_NET_REF_END healthcheck: test: ["CMD", "curl", "-sf", "http://localhost:3000/api/v1/version"] interval: 30s timeout: 5s retries: 3 start_period: 30s networks: ${GITEA_NETWORK_NAME}: external: true # INTERNAL_NET_DEF_START gitea-internal: driver: bridge internal: true # INTERNAL_NET_DEF_END