Complete guide for deploying BeeCompose services in production environments.
- Prerequisites
- First-Time Setup
- Deployment Methods
- Environment Configuration
- Multi-Service Deployments
- Override Files
- Production Checklist
- Troubleshooting
| Component | Minimum Version | Check Command |
|---|---|---|
| Docker | 25.0+ | docker --version |
| Docker Compose | v2.24+ | docker compose version |
| Component | Purpose |
|---|---|
| CloudFlare Account | DNS-01 Let's Encrypt challenge (Traefik) |
| External DNS | Point domains to your server |
| Firewall | Open ports 80, 443 for web traffic |
# Verify Docker version (must be 25.0+ for OCI support)
docker --version
# Docker version 25.0.0, build ...
# Verify Compose version
docker compose version
# Docker Compose version v2.24.0Important: OCI artifact deployment requires Docker 25.0 or later. For older versions, use the Clone and Customize method.
mkdir -p ~/beecompose
cd ~/beecomposeAll BeeCompose services connect through a shared Traefik network:
docker network create traefik_defaultTraefik handles SSL termination and routing for all services.
# Create Traefik environment
cat > traefik.env << 'EOF'
COMPOSE_PROJECT_NAME=traefik
TRAEFIK_DOMAIN=traefik.example.com
CLOUDFLARE_EMAIL=your@email.com
CLOUDFLARE_API_KEY=your-cloudflare-api-key
ACME_EMAIL=your@email.com
EOF
# Deploy Traefik
docker compose \
-f oci://ghcr.io/beevelop/traefik:latest \
--env-file traefik.env \
up -d
# Verify it's running
docker compose \
-f oci://ghcr.io/beevelop/traefik:latest \
--env-file traefik.env \
psEnsure your domain points to your server's IP:
dig +short gitlab.example.com
# Should return your server's IPDeploy directly from GitHub Container Registry without cloning the repository.
# Create environment file for your service
cat > gitlab.env << 'EOF'
COMPOSE_PROJECT_NAME=gitlab
SERVICE_DOMAIN=gitlab.example.com
DB_USER=gitlab
DB_PASS=your-secure-password
GITLAB_ROOT_PASSWORD=your-root-password
EOF
# Deploy
docker compose \
-f oci://ghcr.io/beevelop/gitlab:latest \
--env-file gitlab.env \
up -dAdvantages:
- No local files to maintain
- Always get latest configuration
- Cleaner server setup
Limitations:
- Requires Docker 25.0+
- Cannot customize compose file directly
Clone the repository for full customization control.
# Clone repository
git clone https://github.com/beevelop/beecompose.git
cd beecompose/services/gitlab
# Create environment from example
cp .env.example .env.production
vim .env.production # Edit with your values
# Deploy
docker compose --env-file .env.production up -dAdvantages:
- Full control over compose configuration
- Works with any Docker version
- Easy to customize with override files
Limitations:
- Must manually update for new versions
- Local files to maintain
Every service needs these core variables:
| Variable | Description | Example |
|---|---|---|
COMPOSE_PROJECT_NAME |
Unique project identifier | gitlab |
SERVICE_DOMAIN |
Public hostname | gitlab.example.com |
Services with databases need:
| Variable | Description | Example |
|---|---|---|
DB_USER |
Database username | gitlab |
DB_PASS |
Database password | secure-password |
DB_NAME |
Database name | gitlab_production |
# Generate a secure password
openssl rand -base64 32
# Generate multiple passwords
for i in {1..5}; do openssl rand -base64 32; done# Core settings
COMPOSE_PROJECT_NAME=myservice
SERVICE_DOMAIN=myservice.example.com
# Database
DB_USER=myservice
DB_PASS=$(openssl rand -base64 32)
DB_NAME=myservice_production
# Application secrets
SECRET_KEY=$(openssl rand -base64 64)
# SMTP (optional)
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=notifications@example.com
SMTP_PASS=smtp-passwordCheck each service's .env.example file for required variables:
# View example configuration
curl -s https://raw.githubusercontent.com/beevelop/beecompose/main/services/gitlab/.env.exampleDeploy shared services first, then applications:
# 1. Core infrastructure
docker compose -f oci://ghcr.io/beevelop/traefik:latest --env-file traefik.env up -d
# 2. Shared databases (if needed)
docker compose -f oci://ghcr.io/beevelop/mysql:latest --env-file mysql.env up -d
# 3. Applications
docker compose -f oci://ghcr.io/beevelop/gitlab:latest --env-file gitlab.env up -d
docker compose -f oci://ghcr.io/beevelop/metabase:latest --env-file metabase.env up -dCreate a deployment script:
#!/bin/bash
# deploy-all.sh
set -euo pipefail
SERVICES=(
"traefik:traefik.env"
"gitlab:gitlab.env"
"metabase:metabase.env"
)
for entry in "${SERVICES[@]}"; do
SERVICE="${entry%%:*}"
ENV_FILE="${entry##*:}"
echo "=== Deploying ${SERVICE} ==="
docker compose \
-f "oci://ghcr.io/beevelop/${SERVICE}:latest" \
--env-file "${ENV_FILE}" \
up -d
done
echo "=== All services deployed ==="
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"# View all running containers
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
# View all volumes
docker volume ls
# View Traefik routing
docker compose -f oci://ghcr.io/beevelop/traefik:latest --env-file traefik.env logs traefik | grep "Adding route"When using the clone method, customize services with override files.
cd beecompose/services/gitlab
# Create override file
cat > docker-compose.override.yml << 'EOF'
services:
gitlab:
environment:
- GITLAB_EXTRA_SETTING=value
deploy:
resources:
limits:
memory: 8G
EOF
# Deploy (override is automatically applied)
docker compose --env-file .env.production up -dAdd resource limits:
services:
gitlab:
deploy:
resources:
limits:
cpus: '4'
memory: 8GMount additional volumes:
services:
gitlab:
volumes:
- ./custom-config:/etc/gitlab/custom:roAdd extra environment variables:
services:
gitlab:
environment:
- CUSTOM_VAR=valueChange restart policy:
services:
gitlab:
restart: always- Docker 25.0+ installed
-
traefik_defaultnetwork created - DNS records configured
- Firewall ports 80, 443 open
- Environment files created with secure passwords
- Backup strategy planned
- All containers showing
(healthy)status - SSL certificates issued (check Traefik logs)
- Application accessible via HTTPS
- Backup automation configured
- Monitoring/alerting set up
- No default passwords in production
- Environment files have restricted permissions (
chmod 600) - Unnecessary ports not exposed
- Regular image updates scheduled
- Backup encryption enabled
# Restrict permissions on environment files
chmod 600 *.env
# Verify permissions
ls -la *.env
# -rw------- 1 user user 256 Jan 21 12:00 gitlab.envCheck logs:
docker compose -f oci://ghcr.io/beevelop/gitlab:latest --env-file gitlab.env logsCheck container status:
docker compose -f oci://ghcr.io/beevelop/gitlab:latest --env-file gitlab.env psVerify environment variables:
docker compose -f oci://ghcr.io/beevelop/gitlab:latest --env-file gitlab.env configView health status:
docker inspect --format='{{json .State.Health}}' gitlab | jqCheck health check logs:
docker inspect --format='{{range .State.Health.Log}}{{.Output}}{{end}}' gitlabVerify Traefik network:
docker network inspect traefik_defaultCheck if service is connected:
docker inspect gitlab --format='{{json .NetworkSettings.Networks}}' | jqCheck Traefik ACME logs:
docker compose -f oci://ghcr.io/beevelop/traefik:latest --env-file traefik.env logs | grep -i acmeVerify DNS is correct:
dig +short gitlab.example.comList service volumes:
docker volume ls --filter "name=gitlab"Inspect volume:
docker volume inspect gitlab_app_data| Error | Cause | Solution |
|---|---|---|
network traefik_default not found |
Traefik network doesn't exist | docker network create traefik_default |
port is already allocated |
Another service using the port | Stop conflicting service or change port |
OCI artifact not found |
Service not published or wrong tag | Check artifact exists on GHCR |
manifest unknown |
Wrong image tag | Verify tag on ghcr.io/beevelop |
- Check container logs for specific error messages
- Verify environment file has all required variables
- Ensure prerequisites are met (Docker 25.0+, network exists)
- Review CI/CD documentation for service-specific notes
- Open an issue on GitHub if the problem persists
- Backup Guide - Set up automated backups
- Migration Guide - Migrate from legacy bee scripts
- Service Audit - Review all available services