OCI Artifact - Deploy directly from GitHub Container Registry
GitLab is a complete DevOps platform delivered as a single application. It provides Git repository management, CI/CD pipelines, issue tracking, code review, and much more.
This is a Docker Compose OCI artifact, not a traditional Docker image. It contains a complete docker-compose.yml configuration that you can deploy directly using Docker 25.0+.
# 1. Create environment file
cat > .env.gitlab << 'EOF'
COMPOSE_PROJECT_NAME=gitlab
SERVICE_DOMAIN=gitlab.example.com
DB_PASS=Swordfish
GITLAB_ROOT_PASSWORD=Swordfish
GITLAB_SECRETS_DB_KEY_BASE=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
GITLAB_SECRETS_SECRET_KEY_BASE=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
GITLAB_SECRETS_OTP_KEY_BASE=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
EOF
# 2. Deploy
bc gitlab up
# 3. Check status
bc gitlab psNote: Install the bc CLI with:
curl -fsSL https://raw.githubusercontent.com/beevelop/beecompose/main/scripts/install.sh | sudo bash
# 1. Create environment file
cat > .env.gitlab << 'EOF'
COMPOSE_PROJECT_NAME=gitlab
SERVICE_DOMAIN=gitlab.example.com
DB_PASS=Swordfish
GITLAB_ROOT_PASSWORD=Swordfish
GITLAB_SECRETS_DB_KEY_BASE=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
GITLAB_SECRETS_SECRET_KEY_BASE=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
GITLAB_SECRETS_OTP_KEY_BASE=1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef
EOF
# 2. Deploy from GHCR
docker compose -f oci://ghcr.io/beevelop/gitlab:latest --env-file .env.gitlab up -d --pull always
# 3. Check status
docker compose -f oci://ghcr.io/beevelop/gitlab:latest --env-file .env.gitlab ps- Docker 25.0+ (required for OCI artifact support)
- Docker Compose v2.24+
- Traefik reverse proxy (see traefik)
- Minimum 4GB RAM recommended
This service includes all required backing stores:
| Dependency | Container | Purpose |
|---|---|---|
| PostgreSQL | gitlab-postgres | Primary database (sameersbn/postgresql) |
| Redis | gitlab-redis | Cache and session store |
See Service Dependency Graph for details.
| Container | Image | Purpose |
|---|---|---|
| gitlab | sameersbn/gitlab:18.8.0 | GitLab application server |
| gitlab-postgres | sameersbn/postgresql:15-20230628 | PostgreSQL database |
| gitlab-redis | redis:7-alpine | Redis cache and session store |
| Variable | Description | Example |
|---|---|---|
SERVICE_DOMAIN |
Domain for Traefik routing | gitlab.example.com |
DB_PASS |
PostgreSQL database password | Swordfish |
GITLAB_ROOT_PASSWORD |
Initial root user password | Swordfish |
GITLAB_SECRETS_DB_KEY_BASE |
64-char hex key for database encryption | Generate with openssl rand -hex 64 |
GITLAB_SECRETS_SECRET_KEY_BASE |
64-char hex key for session secrets | Generate with openssl rand -hex 64 |
GITLAB_SECRETS_OTP_KEY_BASE |
64-char hex key for OTP encryption | Generate with openssl rand -hex 64 |
| Variable | Description | Default |
|---|---|---|
COMPOSE_PROJECT_NAME |
Docker Compose project name | gitlab |
TZ |
System timezone | Europe/Berlin |
GITLAB_TIMEZONE |
GitLab application timezone | Berlin |
DB_NAME |
PostgreSQL database name | gitlabhq_production |
DB_USER |
PostgreSQL database user | gitlab |
GIT_PORT |
Host SSH port for Git operations | 2222 |
GITLAB_SSH_HOST |
SSH hostname shown in clone URLs | ${SERVICE_DOMAIN} |
GITLAB_EMAIL |
Sender email for notifications | noreply@example.com |
GITLAB_EMAIL_DISPLAY_NAME |
Email display name | BeeCompose GitLab |
GITLAB_BACKUPS |
Backup schedule | daily |
GITLAB_BACKUP_TIME |
Backup time (HH:MM) | 04:00 |
GITLAB_BACKUP_EXPIRY |
Backup retention (seconds) | 172800 |
GITLAB_BACKUP_SKIP |
Skip backup components | builds,artifacts |
GITLAB_NOTIFY_ON_BROKEN_BUILDS |
Email on broken builds | true |
GITLAB_PROJECTS_SNIPPETS |
Enable project snippets | true |
NGINX_MAX_UPLOAD_SIZE |
Max upload size | 100m |
GITLAB_UNICORN_MEMORY_MAX |
Unicorn max memory (bytes) | 629145600 |
| Variable | Description | Default |
|---|---|---|
SMTP_ENABLED |
Enable SMTP | false |
SMTP_HOST |
SMTP server hostname | - |
SMTP_PORT |
SMTP server port | 587 |
SMTP_USER |
SMTP username | - |
SMTP_PASS |
SMTP password | - |
SMTP_DOMAIN |
SMTP domain | - |
SMTP_TLS |
Enable TLS | true |
SMTP_AUTHENTICATION |
Auth method | login |
| Variable | Description | Default |
|---|---|---|
IMAP_ENABLED |
Enable IMAP | false |
IMAP_HOST |
IMAP server hostname | - |
IMAP_PORT |
IMAP server port | - |
IMAP_USER |
IMAP username | - |
IMAP_PASS |
IMAP password | - |
IMAP_SSL |
Enable SSL | - |
| Volume | Purpose |
|---|---|
postgres_data |
PostgreSQL database files |
gitlab_data |
Git repositories, uploads, and artifacts |
redis_data |
Redis persistence |
| Port | Protocol | Purpose |
|---|---|---|
| 2222 | TCP | SSH for Git operations (configurable via GIT_PORT) |
- Wait for startup: GitLab takes 3-5 minutes to fully initialize
- Access the UI: Navigate to
https://gitlab.example.com - Login as root: Use username
rootand theGITLAB_ROOT_PASSWORD - Configure SSH: Add your SSH key in User Settings → SSH Keys
- Clone via SSH: Use port 2222 (or your configured
GIT_PORT):git clone ssh://git@gitlab.example.com:2222/username/repo.git
- Configure SMTP: Enable email notifications by setting SMTP variables
- Set up runners: Install GitLab Runner for CI/CD pipelines
bc gitlab logs -f # View logs
bc gitlab restart # Restart
bc gitlab down # Stop
bc gitlab update # Pull and recreate# Define alias for convenience
alias dc="docker compose -f oci://ghcr.io/beevelop/gitlab:latest --env-file .env.gitlab"
# View logs
dc logs -f
# Restart
dc restart
# Stop
dc down
# Update
dc pull && dc up -d
# Access Rails console
docker exec -it gitlab sudo -u git -H bundle exec rails console -e production
# Create backup manually
docker exec -it gitlab sudo -u git -H bundle exec rake gitlab:backup:create RAILS_ENV=productionGitLab requires significant startup time (3-5 minutes). Check logs for progress:
dc logs -f gitlabEnsure the GIT_PORT is accessible and not blocked by firewall. Verify SSH is working:
ssh -T git@gitlab.example.com -p 2222Verify SMTP settings and check logs for email errors. Test with:
docker exec -it gitlab sudo -u git -H bundle exec rails console -e production
# Then run: Notify.test_email('your@email.com', 'Test', 'Test').deliver_nowCheck logs with dc logs gitlab and ensure all required environment variables are set.