my foregejo docker compose setup
  • Dockerfile 100%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-04-19 00:49:31 +08:00
.env.example first commit 2026-04-19 00:39:25 +08:00
Caddyfile first commit 2026-04-19 00:39:25 +08:00
docker-compose.yml first commit 2026-04-19 00:39:25 +08:00
Dockerfile first commit 2026-04-19 00:39:25 +08:00
README.md fix: clean README markdown 2026-04-19 00:49:31 +08:00

Forgejo Stack

Exportable Forgejo version of the root Gitea stack. Copy this directory to the new server, create a .env file from .env.example, then start it with Docker Compose.

Files

  • docker-compose.yml: Forgejo, PostgreSQL, and Caddy services.
  • Caddyfile: HTTPS reverse proxy for Forgejo with Cloudflare DNS validation.
  • Dockerfile: custom Caddy build with the Cloudflare DNS plugin.
  • .env.example: placeholders for the destination server's domain and secrets.

Setup

cp .env.example .env

Edit .env before starting the stack:

FORGEJO_DOMAIN=forgejo.example.com
FORGEJO_DB_PASSWORD=use-a-long-random-password
CLOUDFLARE_API_TOKEN=use-a-cloudflare-token-for-dns-validation

Validate and start:

docker compose config --quiet
docker compose up -d --build

Forgejo will listen on 3000, SSH will listen on 2222, and Caddy will listen on 80 and 443.