50 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			YAML
		
	
	
	
	
	
| # documentation: https://forgejo.org/docs
 | |
| # slogan: Forgejo is a self-hosted lightweight software forge. Easy to install and low maintenance, it just does the job.
 | |
| # tags: version control, collaboration, code, hosting, lightweight, postgresql
 | |
| # logo: svgs/forgejo.svg
 | |
| # port: 3000
 | |
| 
 | |
| services:
 | |
|   forgejo:
 | |
|     image: codeberg.org/forgejo/forgejo:8
 | |
|     environment:
 | |
|       - SERVICE_FQDN_FORGEJO_3000
 | |
|       - FORGEJO__server__ROOT_URL=${SERVICE_FQDN_FORGEJO_3000}
 | |
|       - FORGEJO__migrations__ALLOWED_DOMAINS=${FORGEJO__migrations__ALLOWED_DOMAINS}
 | |
|       - FORGEJO__migrations__ALLOW_LOCALNETWORKS=${FORGEJO__migrations__ALLOW_LOCALNETWORKS-false}
 | |
|       - USER_UID=1000
 | |
|       - USER_GID=1000
 | |
|       - FORGEJO__database__DB_TYPE=postgres
 | |
|       - FORGEJO__database__HOST=postgresql
 | |
|       - FORGEJO__database__NAME=${POSTGRESQL_DATABASE-forgejo}
 | |
|       - FORGEJO__database__USER=$SERVICE_USER_POSTGRESQL
 | |
|       - FORGEJO__database__PASSWD=$SERVICE_PASSWORD_POSTGRESQL
 | |
|     volumes:
 | |
|       - forgejo-data:/data
 | |
|       - forgejo-timezone:/etc/timezone:ro
 | |
|       - forgejo-localtime:/etc/localtime:ro
 | |
|     ports:
 | |
|       - 22222:22
 | |
|     depends_on:
 | |
|       postgresql:
 | |
|         condition: service_healthy
 | |
|     healthcheck:
 | |
|       test: ["CMD", "curl", "-f", "http://127.0.0.1:3000"]
 | |
|       interval: 2s
 | |
|       timeout: 10s
 | |
|       retries: 15
 | |
| 
 | |
|   postgresql:
 | |
|     image: postgres:16-alpine
 | |
|     volumes:
 | |
|       - forgejo-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
 | 
