π Documentation: https://andrewdi.github.io/ansible-galaxy-compose/
Native Docker Compose configuration based on galaxy-operator.
This project includes the following core components:
- PostgreSQL 15 - Primary database for Galaxy data
- Redis 7 - Cache and message queue
- Galaxy API - Pulp 3 Galaxy API service
- Galaxy Content - Content service component
- Galaxy Worker - Background task worker
- Galaxy Web UI - Web user interface
Note: Nginx is not included, Galaxy services are directly exposed via ports
This configuration uses pre-built images from quay.io:
# Image configuration in docker-compose.yml
galaxy-api:
image: quay.io/ansible/galaxy-ng:latest
galaxy-web:
image: quay.io/ansible/galaxy-ui:latest# Copy environment variable file
cp .env.example .env
# Create certificates directory
mkdir -p certs
# Generate database encryption key (required for pulpcore)
# The key is automatically generated on first run, or you can generate it manually:
python3 -c "import os; print(os.urandom(32).hex())" > certs/database_fields.symmetric.key
chmod 600 certs/database_fields.symmetric.key
# Edit environment variables (optional)
vim .env# Create network and volumes
docker compose up -d
# View logs
docker compose logs -f- Web UI: http://localhost:8080
- API: http://localhost:8000/api/galaxy/
- Pulp API: http://localhost:8000/pulp/api/v3/
- Content: http://localhost:24816/pulp/content/
Default admin account:
- Username:
admin - Password:
admin
docker compose down
# Keep data
docker compose down -v
# Full cleanup (including volumes)
docker compose down -v --remove-orphansMain configuration options:
| Variable | Default | Description |
|---|---|---|
POSTGRESQL_USER |
galaxy | Database username |
POSTGRESQL_PASSWORD |
galaxy | Database password |
POSTGRESQL_HOST |
postgres | Database host |
POSTGRESQL_PORT |
5432 | Database port |
REDIS_HOST |
redis | Redis host |
REDIS_PORT |
6379 | Redis port |
REDIS_PASSWORD |
galaxy | Redis password |
GALAXY_ADMIN_USER |
admin | Admin username |
GALAXY_ADMIN_PASSWORD |
admin | Admin password |
PULP_SECRET_KEY |
- | Django secret key |
GALAXY_API_HOSTNAME |
http://galaxy-web.orb.local | Galaxy API hostname |
Modify image version in docker-compose.yml:
services:
galaxy-api:
image: quay.io/ansible/galaxy-ng:v1.0.0Data is stored in the following Docker volumes:
postgres_data- PostgreSQL datagalaxy_api_data- Galaxy API, Content, and Worker shared data (artifacts, etc.)
Note: Redis is configured in non-persistent mode, data will not be persisted
# View all service logs
docker compose logs
# View specific service logs
docker compose logs galaxy-api
# Real-time logs
docker compose logs -f galaxy-api# Enter API container
docker exec -it galaxy-api bash
# Enter database container
docker exec -it galaxy-postgres psql -U galaxy# Enter API container
docker exec -it galaxy-api bash
# Run Django management commands
python manage.py createsuperuser
python manage.py collectstatic- Change default passwords: Update all passwords in
.envfile - Use external database: Configure PostgreSQL as externally managed
- Add reverse proxy: Optionally add Nginx or other proxy for HTTPS and load balancing
- Resource limits: Add resource limits in
docker-compose.yml - Backup strategy: Regularly backup
postgres_datavolume
ansible-galaxy/
βββ docker-compose.yml # Main configuration file
βββ .env.example # Environment variables example
βββ .env.ci # CI environment variables
βββ .gitignore # Git ignore file
βββ README.md # This document
βββ README.zh-CN.md # Chinese version
βββ LICENSE # Mulan PSL v2 License
βββ Makefile # Convenience commands
βββ ansible.cfg # Ansible configuration
βββ certs/ # SSL/TLS certificates
βββ config/
β βββ settings.py # Galaxy/Pulp configuration
βββ galaxy_service/ # Galaxy collection for testing
β βββ GALAXY.yml
β βββ README.md
β βββ plugins/
βββ init-scripts/
β βββ 01-init-db.sh # Database initialization script
βββ nginx/ # Nginx configuration
β βββ nginx.conf
β βββ conf.d/
βββ scripts/ # Backup and utility scripts
βββ backup.sh
βββ restore.sh
βββ scheduler.sh
# Check PostgreSQL status
docker compose logs postgres
# Restart PostgreSQL
docker compose restart postgres# Check API logs
docker compose logs galaxy-api
# Ensure database is fully started
docker compose psIf the following ports are occupied, modify the port mappings in docker-compose.yml:
| Service | Default Port | Description |
|---|---|---|
| Galaxy Web | 8080 | Web UI port |
| Galaxy API | 8000 | API service port |
| Galaxy Content | 24816 | Content service port |
| PostgreSQL | 5432 | Database port |
| Redis | 6379 | Cache port |
Example modification:
galaxy-web:
ports:
- "8081:8080" # Change to 8081- π Documentation - Full documentation with config reference
- Galaxy Operator Documentation
- Pulp Project
- Ansible Galaxy