The Docker Compose configuration has been organized into multiple files to support both Community Edition (CE) and Enterprise Edition (EE) while following best practices and eliminating duplication.
docker-compose.base.yaml
: Contains shared service definitions for postgres and redisdocker-compose.ce.yaml
: Community Edition specific configurationsdocker-compose.ee.yaml
: Enterprise Edition specific configurations
The base configuration (docker-compose.base.yaml
) includes:
- Core service definitions for postgres and redis
- Shared network configuration
- Secret definitions
The CE configuration (docker-compose.ce.yaml
) includes:
- Standard service configurations
- CE-specific Dockerfile paths
- Default community settings
- Service environment variables
- Network and dependency configurations
The EE configuration (docker-compose.ee.yaml
) includes:
- Enterprise-specific database setup
- EE-specific Dockerfile paths
- Additional enterprise features and settings
- Service environment variables
- Network and dependency configurations
# Development
docker compose -f docker-compose.base.yaml -f docker-compose.ce.yaml up
# Production
docker compose -f docker-compose.base.yaml -f docker-compose.ce.yaml -f docker-compose.prod.yaml up -d
# Development
docker compose -f docker-compose.base.yaml -f docker-compose.ee.yaml up
# Production
docker compose -f docker-compose.base.yaml -f docker-compose.ee.yaml -f docker-compose.prod.yaml up -d
Each service has its own environment variable configuration that includes:
- Basic application settings (VERSION, APP_NAME, etc.)
- Database configuration
- Redis settings
- Service-specific variables
Example:
environment:
VERSION: ${VERSION}
APP_NAME: ${APP_NAME}
APP_ENV: ${APP_ENV:-development}
NODE_ENV: ${APP_ENV:-development}
DB_HOST: postgres
DB_PORT: ${DB_PORT:-5432}
# ... other variables
Services extend from their base definitions using Docker Compose's extends
feature:
services:
postgres:
extends:
file: docker-compose.base.yaml
service: postgres
Secrets are defined in the base configuration and referenced in service configurations:
secrets:
- db_password_server
- redis_password
# ... other secrets
-
Service Organization
- Keep base services in docker-compose.base.yaml
- Use edition-specific files for specialized configurations
- Maintain clear separation between CE and EE features
-
Environment Variables
- Define defaults in compose files
- Use .env files for local overrides
- Follow naming conventions
-
Service Dependencies
- Use
depends_on
with conditions - Ensure proper startup order
- Handle service readiness
- Use
-
Network Configuration
- Use dedicated networks
- Name networks consistently
- Control service exposure
- Make changes to the base configuration if they apply to both editions
- Update edition-specific configurations as needed
- Test changes in both CE and EE environments
- Update documentation if the structure changes
If you encounter issues:
- Verify you're using the correct combination of compose files
- Check environment variables are properly set
- Ensure secrets exist in the correct location
- Review service logs for specific error messages
Common issues and solutions:
# Check postgres logs
docker compose logs postgres
# Verify environment variables
docker compose config
# Check service logs
docker compose logs [service-name]
# Verify service configuration
docker compose config --services
- The base configuration provides core services and shared settings
- Edition-specific files add features and customizations
- Environment variables should be properly set in .env files
- Secrets are managed through Docker secrets
- Service dependencies are handled through depends_on conditions
- Networks are isolated per environment