Skip to main content

Docker Deployment

AlertifyPro ships with Docker Compose files for easy self-hosted deployment.

Prerequisites

  • Docker Engine ≥ 24.0
  • Docker Compose ≥ 2.20

Repository structure

backend/
├── docker-compose.yml # All services (app + infra)
├── docker-compose.infra.yml # PostgreSQL + Redis only
├── docker-compose.external.yml # For connecting to external DB/Redis
├── .env.example # Copy to .env and configure
└── docker/ # Dockerfiles

Quick start

cd backend

# 1. Copy and configure environment variables
cp .env.example .env
# Edit .env — at minimum set JWT_SECRET and ENCRYPTION_KEY

# 2. Start all services (app + PostgreSQL + Redis)
docker compose up -d

# 3. Apply database schema
make db-init

# 4. (Optional) Seed sample data
make seed

# 5. Test the API
curl http://localhost:3001/api/v1/health
# Response: OK

docker-compose.yml overview

The main compose file starts the full AlertifyPro stack:

ServiceDescriptionPort
apiREST API server3001
schedulerCheck scheduler + alert engine
notification-workerSends alert notifications
postgresPostgreSQL 155432
redisRedis 76379

Using an external database

If you already have PostgreSQL and Redis running (locally or on a cloud provider), use docker-compose.external.yml:

# Edit .env with your DB_URL and REDIS_URL
docker compose -f docker-compose.external.yml up -d

Environment variables

The minimum required variables:

ENV=production
PORT=3001
DB_URL=postgres://postgres:postgres@localhost:5432/alertify_pro?sslmode=disable
REDIS_URL=redis://localhost:6379/0
JWT_SECRET=your_min_32_char_secret_here
ENCRYPTION_KEY=exactly_32_bytes_long_key!!!!
CONCURRENCY=100

See the full Environment Variables reference →

Makefile commands

The Makefile packages the most common tasks:

make run-api          # Start the API server
make db-init # Create database schema
make db-init DB_URL=<url> # Against a specific database
make seed # Load sample data

Health checks

# Liveness
curl http://localhost:3001/api/v1/health
# → OK

# Readiness (checks database)
curl http://localhost:3001/api/v1/ready
# → {"status":"ready"}

Updating

docker compose pull
docker compose up -d
# Re-run migrations if DB schema changed
make db-init