GitLab CE deployment with Docker Compose, featuring automatic root API token provisioning and a Python client library.
| Service | Description |
|---|---|
gitlab |
GitLab CE 18.7.0 with HTTPS (Let's Encrypt), Pages, and SSH |
gitlab-init-token |
One-shot container that auto-creates a root personal access token |
gitlab-runner |
GitLab Runner for CI/CD and Pages builds |
export GITLAB_URL="https://your-domain.com"
export GITLAB_PRIVATE_TOKEN="your-secret-token-here"
docker compose up -d
# Monitor token creation
docker logs -f gitlab-init-tokenexport GITLAB_URL="http://localhost"
export GITLAB_PRIVATE_TOKEN="your-secret-token-here"
docker compose up -dThe compose file automatically adapts based on GITLAB_URL:
- HTTPS URLs: Enables Let's Encrypt auto-renewal and GitLab Pages
- HTTP / localhost: Disables Let's Encrypt and Pages
| Variable | Default | Description |
|---|---|---|
GITLAB_URL |
(required) | GitLab instance URL (used by both Docker and Python client) |
GITLAB_PRIVATE_TOKEN |
(required) | Root personal access token value |
Create a .env file in the project root for the Python client:
GITLAB_URL=https://your-domain.com
GITLAB_PRIVATE_TOKEN=your-secret-token-here