Airflow PostgreSQL Redis Production Compose Starter
Copy a production-oriented Airflow + PostgreSQL + Redis docker-compose.yml with restart policies and private networking — generated locally, no signup.
Airflow + PostgreSQL + Redis
Copy a production-oriented Airflow + PostgreSQL + Redis docker-compose.yml with restart policies and private networking — generated locally, no signup.
This tool runs locally in your browser. Your input is not uploaded.
Copy the generated result or open the full tool to adjust inputs locally.
Airflow + PostgreSQL + Redis
services:
airflow-webserver:
image: "apache/airflow:2.9.3"
command: airflow webserver
env_file:
- .env
ports:
- "8080:8080"
depends_on:
- db
working_dir: /app
restart: unless-stopped
networks:
- app_network
db:
image: "postgres:16-alpine"
environment:
POSTGRES_DB: "${POSTGRES_DB}"
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
volumes:
- "postgres_data:/var/lib/postgresql/data"
healthcheck:
test:
- CMD-SHELL
- "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"
interval: "10s"
timeout: "5s"
retries: 5
restart: unless-stopped
networks:
- app_network
redis:
image: "redis:7-alpine"
volumes:
- "redis_data:/data"
healthcheck:
test:
- CMD-SHELL
- redis-cli ping
interval: "10s"
timeout: "5s"
retries: 5
restart: unless-stopped
networks:
- app_network
airflow-scheduler:
image: "apache/airflow:2.9.3"
command: airflow scheduler
env_file:
- .env
depends_on:
- db
- redis
restart: unless-stopped
networks:
- app_network
volumes:
postgres_data: {}
redis_data: {}
networks:
app_network:
driver: bridge
# .env.example
COMPOSE_PROJECT_NAME=airflow_prod
APP_PORT=8080
APP_ENV=production
APP_SECRET=change-me
POSTGRES_DB=app
POSTGRES_USER=app
POSTGRES_PASSWORD=change-me
DATABASE_URL=postgresql://app:change-me@db:5432/app
DATABASE_PORT=5432
REDIS_URL=redis://redis:6379/0
REDIS_PORT=6379
AIRFLOW__CORE__EXECUTOR=CeleryExecutor
AIRFLOW__CORE__FERNET_KEY=change-me-fernet-key
# Commands
cp .env.example .env
docker compose up -d --build
docker compose ps
docker compose logs -f airflow-webserver
docker compose exec airflow-webserver sh
docker compose down
docker compose down -v # remove named volumes and local data
# Notes
PostgreSQL internal: postgresql://app:${POSTGRES_PASSWORD}@db:5432/app
PostgreSQL local: postgresql://app:${POSTGRES_PASSWORD}@localhost:${DATABASE_PORT}/app
Redis internal: redis://redis:6379/0
Redis local: redis://localhost:${REDIS_PORT}/0
Preset: Airflow + PostgreSQL + Redis
Mode: production
Notes:
- Review image tags, commands, and mounted paths for your actual application layout.
- Secrets are represented as environment variables in .env.example; replace placeholder values before use.
- Healthchecks are included for supported infrastructure services.
- Named Docker volumes are enabled for local persistence.
- Warning: Production mode adds restart policies, but this is a starting point and not hardened production infrastructure.
# Warning: Production mode adds restart policies, but this is a starting point and not hardened production infrastructure.Copy a production-oriented Airflow + PostgreSQL + Redis docker-compose.yml with restart policies and private networking — generated locally, no signup.
Airflow + PostgreSQL + Redis
It is a strong starter, not a hardened production deployment. Review secrets, TLS, backups, resource limits, and network exposure before production use.
No. Preset generation is static and the interactive builder runs locally in the browser.
Yes. The page exposes copyable and downloadable output for docker-compose.yml and related notes.