Add Forgejo container
This commit is contained in:
parent
97a6e683fc
commit
05c3dc210f
3 changed files with 68 additions and 0 deletions
8
forgejo/.env
Normal file
8
forgejo/.env
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# Forgejo
|
||||||
|
FORGEJO_VERSION=10
|
||||||
|
FORGEJO_DOMAIN=forgejo.example.com
|
||||||
|
|
||||||
|
# PostgreSQL
|
||||||
|
FORGEJO_POSTGRES_VERSION=16
|
||||||
|
FORGEJO_POSTGRES_USER=forgejo
|
||||||
|
FORGEJO_POSTGRES_PASSWORD=your_secure_password
|
0
forgejo/README.md
Normal file
0
forgejo/README.md
Normal file
60
forgejo/docker-compose.yml
Normal file
60
forgejo/docker-compose.yml
Normal file
|
@ -0,0 +1,60 @@
|
||||||
|
---
|
||||||
|
services:
|
||||||
|
forgejo:
|
||||||
|
image: codeberg.org/forgejo/forgejo:${FORGEJO_VERSION:-10}
|
||||||
|
container_name: forgejo
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- traefik
|
||||||
|
- database
|
||||||
|
volumes:
|
||||||
|
- data:/data
|
||||||
|
- /etc/timezone:/etc/timezone:ro
|
||||||
|
- /etc/localtime:/etc/localtime:ro
|
||||||
|
environment:
|
||||||
|
- USER_UID=1000
|
||||||
|
- USER_GID=1000
|
||||||
|
- FORGEJO__database__DB_TYPE=postgres
|
||||||
|
- FORGEJO__database__HOST=forgejo-db:5432
|
||||||
|
- FORGEJO__database__NAME=${FORGEJO_POSTGRES_USER:-forgejo}
|
||||||
|
- FORGEJO__database__USER=${FORGEJO_POSTGRES_USER}
|
||||||
|
- FORGEJO__database__PASSWD=${FORGEJO_POSTGRES_PASSWORD}
|
||||||
|
labels:
|
||||||
|
- "traefik.enable=true"
|
||||||
|
- "traefik.docker.network=traefik"
|
||||||
|
- "traefik.http.routers.forgejo.entrypoints=http"
|
||||||
|
- "traefik.http.routers.forgejo.rule=Host(`${FORGEJO_DOMAIN}`)"
|
||||||
|
- "traefik.http.middlewares.forgejo-https-redirect.redirectscheme.scheme=https"
|
||||||
|
- "traefik.http.routers.forgejo.middlewares=forgejo-https-redirect"
|
||||||
|
- "traefik.http.routers.forgejo-secure.entrypoints=https"
|
||||||
|
- "traefik.http.routers.forgejo-secure.rule=Host(`${FORGEJO_DOMAIN}`)"
|
||||||
|
- "traefik.http.routers.forgejo-secure.tls=true"
|
||||||
|
- "traefik.http.routers.forgejo-secure.service=forgejo"
|
||||||
|
- "traefik.http.services.forgejo.loadbalancer.server.port=3000"
|
||||||
|
depends_on:
|
||||||
|
- forgejo-db
|
||||||
|
|
||||||
|
forgejo-db:
|
||||||
|
image: postgres:${FORGEJO_POSTGRES_VERSION:-16}
|
||||||
|
container_name: forgejo-db
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
- POSTGRES_USER=${FORGEJO_POSTGRES_USER}
|
||||||
|
- POSTGRES_PASSWORD=${FORGEJO_POSTGRES_PASSWORD}
|
||||||
|
- POSTGRES_DB=forgejo
|
||||||
|
networks:
|
||||||
|
- database
|
||||||
|
volumes:
|
||||||
|
- db:/var/lib/postgresql/data
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
data:
|
||||||
|
external: true
|
||||||
|
db:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
networks:
|
||||||
|
traefik:
|
||||||
|
external: true
|
||||||
|
database:
|
||||||
|
driver: bridge
|
Loading…
Add table
Reference in a new issue