feat: add dedicated postgres:16-alpine database service for Forgejo
This commit is contained in:
parent
36216ffefc
commit
7daee26d3d
1 changed files with 28 additions and 1 deletions
|
|
@ -10,15 +10,43 @@ networks:
|
|||
volumes:
|
||||
forgejo_data:
|
||||
driver: local
|
||||
forgejo_db_data:
|
||||
driver: local
|
||||
|
||||
services:
|
||||
forgejo-db:
|
||||
image: postgres:16-alpine
|
||||
container_name: forgejo-db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
POSTGRES_DB: ${FORGEJO_DB_NAME:-forgejo}
|
||||
POSTGRES_USER: ${FORGEJO_DB_USER:-forgejo}
|
||||
POSTGRES_PASSWORD: ${FORGEJO_DB_PASS:-forgejo_secure_pass_2026}
|
||||
volumes:
|
||||
- forgejo_db_data:/var/lib/postgresql/data
|
||||
networks:
|
||||
- forgejo_internal
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U ${FORGEJO_DB_USER:-forgejo} -d ${FORGEJO_DB_NAME:-forgejo}"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
forgejo:
|
||||
image: codeberg.org/forgejo/forgejo:9.0-rootless
|
||||
container_name: forgejo
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
forgejo-db:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
- USER_UID=1000
|
||||
- USER_GID=1000
|
||||
- FORGEJO__database__DB_TYPE=postgres
|
||||
- FORGEJO__database__HOST=forgejo-db:5432
|
||||
- FORGEJO__database__NAME=${FORGEJO_DB_NAME:-forgejo}
|
||||
- FORGEJO__database__USER=${FORGEJO_DB_USER:-forgejo}
|
||||
- FORGEJO__database__PASSWD=${FORGEJO_DB_PASS:-forgejo_secure_pass_2026}
|
||||
- FORGEJO__server__DOMAIN=git.thecr3wnet.com
|
||||
- FORGEJO__server__ROOT_URL=https://git.thecr3wnet.com/
|
||||
- FORGEJO__server__HTTP_PORT=3000
|
||||
|
|
@ -34,4 +62,3 @@ services:
|
|||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue