my foregejo docker compose setup
- Dockerfile 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .env.example | ||
| Caddyfile | ||
| docker-compose.yml | ||
| Dockerfile | ||
| README.md | ||
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.