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:latestDocker 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
| Platform | Type | Notes |
|---|---|---|
| Railway | PaaS | One-click deploy with Dockerfile |
| Render | PaaS | Free tier available |
| AWS ECS | Containers | Scalable container orchestration |
| DigitalOcean | VPS/Apps | App Platform or Droplets |
Production Checklist
Before deploying: Set DEBUG=False, use strong SECRET_KEY, enable HTTPS, configure CORS properly.