Official Docker image builder for pretalx, a conference planning tool.
-
Clone this repository
git clone https://github.com/pretalx/pretalx-docker-image.git cd pretalx-docker-image -
Create environment file
cp .env.example .env
-
Edit
.envand set at minimum:POSTGRES_PASSWORD: A secure database passwordPRETALX_SECRET_KEY: A random secret key (generate withopenssl rand -base64 32)PRETALX_SITE_URL: Your site URL (e.g.,https://pretalx.example.com)COMPOSE_PROFILES=local-db: Keeps the bundled PostgreSQL service enabled (default). Clear the value to use an external database and setPOSTGRES_HOST.
-
Start the services
docker compose up -d
With
COMPOSE_PROFILES=local-dbthis launches the bundled PostgreSQL container. If you cleared the profile and setPOSTGRES_HOST, the stack connects to your external database instead. -
Create a superuser
docker compose exec web python manage.py createsuperuser -
Access pretalx Open your browser to
http://localhost:8080
Pull the latest image from GitHub Container Registry:
docker pull ghcr.io/coscup/pretalx:latestRun web server:
docker run -d -p 8000:8000 \
-e POSTGRES_PASSWORD=secret \
-e PRETALX_SECRET_KEY=your-secret-key \
-e PRETALX_SITE_URL=http://localhost:8000 \
-v pretalx_data:/data \
-v pretalx_public:/public \
ghcr.io/coscup/pretalx:latest webSee .env.example for all available configuration options.
COMPOSE_PROFILES=local-db: Start the bundled PostgreSQL service (default). Clear the value to disable the container and connect to an external database.POSTGRES_HOST: PostgreSQL hostname (default:db). When you disable the bundled database, set this to your external host.POSTGRES_PORT: PostgreSQL port (default:5432)POSTGRES_DB: Database name (default:pretalx)POSTGRES_USER: Database user (default:pretalx)POSTGRES_PASSWORD: Database password (required)
POSTGRES_PASSWORD: Database passwordPRETALX_SECRET_KEY: Django secret keyPRETALX_SITE_URL: Public URL of your instance
PRETALX_VERSION: pretalx version to build (tag or branch, default: main)PRETALX_IMAGE: Use pre-built image instead of building (optional)
GUNICORN_WORKERS: Number of worker processes (default: 4)GUNICORN_MAX_REQUESTS: Max requests per worker (default: 1200)GUNICORN_MAX_REQUESTS_JITTER: Request jitter (default: 50)GUNICORN_FORWARDED_ALLOW_IPS: Trusted proxy IPs (default: *)
pretalx_data: Application data and logspretalx_public: Static and media files (for reverse proxy)postgres_data: PostgreSQL databaseredis_data: Redis data
The Docker Compose setup includes:
- migrate: One-time migration service (runs before other services)
- web: Gunicorn WSGI server on port 8000
- worker: Celery background task worker
- db: PostgreSQL 15 database (enabled when
COMPOSE_PROFILESincludeslocal-db) - redis: Redis for caching and Celery
- Edit
.env, clear theCOMPOSE_PROFILESvalue (or comment it out) so the bundleddbservice is not started. - Set
POSTGRES_HOST(and optionallyPOSTGRES_PORT) to point at your external database. - Ensure
POSTGRES_DB,POSTGRES_USER, andPOSTGRES_PASSWORDmatch the external database credentials. - Start the stack with
docker compose up -d. Docker Compose skips thedbservice automatically, and migrate/web/worker wait until they can connect to the external database.
For production, use a reverse proxy (nginx, Traefik, Caddy) to:
- Serve static files from
/public/static/and/public/media/ - Provide HTTPS/SSL termination
- Handle load balancing if scaling web services
Example nginx configuration is available in reverse-proxy-examples/nginx/.
Scale web and worker services independently:
docker compose up -d --scale web=3 --scale worker=5Note: You'll need a load balancer in front when scaling web services.
# Build latest main branch
docker compose build
# Build specific version
docker compose build --build-arg PRETALX_VERSION=v2024.1.0docker build -t pretalx:custom \
--build-arg PRETALX_VERSION=main \
.# Create superuser
docker compose exec web python manage.py createsuperuser
# Django shell
docker compose exec web python manage.py shell
# Run migrations manually
docker compose exec web python manage.py migrate
# View logs
docker compose logs -f web
docker compose logs -f worker
# Rebuild frontend assets
docker compose exec web python manage.py rebuildImages are published to ghcr.io/coscup/pretalx:
latest: Latest stable build from pretalx main branchmain: Latest commit from pretalx main branchv*: Specific version releases (e.g.,v2024.1.0)
# Pull latest image
docker compose pull
# Restart services (migrations run automatically)
docker compose down
docker compose up -dThis repository:
- Clones the pretalx repository at the specified version
- Builds the Docker image with all dependencies
- Publishes to GitHub Container Registry via GitHub Actions
The build is triggered:
- Automatically when pretalx repository pushes to main
- On demand via workflow_dispatch
- On tags in this repository
This Docker configuration is licensed under the Apache License 2.0. pretalx itself is licensed under the Apache License 2.0.