lasthourcloud/templates/compose/gitea-with-postgresql.yaml

46 lines
1.4 KiB
YAML
Raw Normal View History

2023-11-03 12:55:14 +00:00
# documentation: https://docs.gitea.com
2024-02-20 14:07:12 +00:00
# slogan: Gitea is a self-hosted, lightweight Git service, offering version control, collaboration, and code hosting.
2023-11-03 12:55:14 +00:00
# tags: version control, collaboration, code, hosting, lightweight, postgresql
2024-02-20 14:07:12 +00:00
# logo: svgs/gitea.svg
2023-11-03 12:55:14 +00:00
services:
gitea:
image: gitea/gitea:latest
environment:
2023-11-07 09:18:28 +00:00
- SERVICE_FQDN_GITEA_3000
2023-11-03 12:55:14 +00:00
- USER_UID=1000
- USER_GID=1000
- GITEA__database__DB_TYPE=postgres
- GITEA__database__HOST=postgresql
- GITEA__database__NAME=${POSTGRESQL_DATABASE-gitea}
- GITEA__database__USER=$SERVICE_USER_POSTGRESQL
- GITEA__database__PASSWD=$SERVICE_PASSWORD_POSTGRESQL
volumes:
- gitea-data:/data
2023-11-03 12:55:14 +00:00
- gitea-timezone:/etc/timezone:ro
- gitea-localtime:/etc/localtime:ro
2023-11-07 09:18:28 +00:00
ports:
- 22222:22
2023-11-03 12:55:14 +00:00
depends_on:
postgresql:
condition: service_healthy
healthcheck:
2024-05-17 08:11:55 +00:00
test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"]
2023-11-03 12:55:14 +00:00
interval: 2s
timeout: 10s
retries: 15
postgresql:
image: postgres:16-alpine
2023-11-03 12:55:14 +00:00
volumes:
- gitea-postgresql-data:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${SERVICE_USER_POSTGRESQL}
- POSTGRES_PASSWORD=${SERVICE_PASSWORD_POSTGRESQL}
- POSTGRES_DB=${POSTGRESQL_DATABASE}
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"]
interval: 5s
timeout: 20s
retries: 10