Skip to main content

Overview

While gitGost does not currently ship with an official Dockerfile, deploying via Docker is straightforward. This guide provides production-ready Docker configurations.
The gitGost repository does not include a Dockerfile yet. This guide provides a reference implementation you can use.

Creating a Dockerfile

Create a Dockerfile in the root of the gitGost repository:
Dockerfile

Building the Docker Image

1

Build with version info

2

Verify the image

3

Test run

Docker Run Command

For a simple deployment without Docker Compose:

Using an .env file

Docker Compose

Basic Configuration

Create docker-compose.yml:
docker-compose.yml

Production Configuration with nginx

Create docker-compose.prod.yml:
docker-compose.prod.yml
Create nginx.conf:
nginx.conf

Usage

1

Create .env file

2

Start services

3

View logs

4

Stop services

Volume Mounts

gitGost does not require persistent volumes by design. All git operations are ephemeral.
Do not mount /tmp or other writable directories unless you understand the security implications. gitGost is designed to be stateless.

Optional: Persistent Logs

If you want to persist logs outside the container:

Port Mappings

gitGost uses a single port for all operations (health, metrics, git-receive-pack, admin, etc.).

Multi-Architecture Builds

To build for multiple platforms (e.g., ARM64 for Raspberry Pi):

Container Registry

Push to Docker Hub

Push to GitHub Container Registry

Troubleshooting

Container Exits Immediately

Health Check Failing

Build Fails

Security Best Practices

Use Secrets

Use Docker secrets or environment files instead of hardcoding credentials in docker-compose.yml.

Run as Non-Root

The Dockerfile provided runs as a non-root user (UID 1000) for security.

Network Isolation

Use custom networks to isolate gitGost from other containers.

TLS Termination

Always use a reverse proxy (nginx, Traefik, Caddy) with TLS for production.

Next Steps

Environment Variables

Complete reference of all configuration options

Configuration

Advanced configuration and production hardening

Requirements

System requirements and prerequisites