Deployment

Deploy ForgeAPI to production with Docker or cloud platforms.

Docker Deployment

Terminal
# Build the production image
docker build -t forgeapi:latest .

# Run with environment variables
docker run -d \
  -p 8000:8000 \
  -e DATABASE_URL=postgresql://... \
  -e SECRET_KEY=your-secret \
  forgeapi:latest

Docker Compose (Production)

docker-compose.prod.yml
version: "3.8"
services:
  api:
    build: .
    ports:
      - "8000:8000"
    environment:
      - DATABASE_URL=${DATABASE_URL}
      - SECRET_KEY=${SECRET_KEY}
      - REDIS_URL=redis://redis:6379
    depends_on:
      - db
      - redis

  db:
    image: postgres:15
    environment:
      POSTGRES_DB: forgeapi
      POSTGRES_USER: ${DB_USER}
      POSTGRES_PASSWORD: ${DB_PASS}
    volumes:
      - postgres_data:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine

volumes:
  postgres_data:

Cloud Platforms

PlatformTypeNotes
RailwayPaaSOne-click deploy with Dockerfile
RenderPaaSFree tier available
AWS ECSContainersScalable container orchestration
DigitalOceanVPS/AppsApp Platform or Droplets

Production Checklist

Before deploying: Set DEBUG=False, use strong SECRET_KEY, enable HTTPS, configure CORS properly.