Docker Deployment
Production-ready containerization.
Docker Compose#
We provide a docker-compose.prod.yml file optimized for production. It sets up the Next.js app, PostgreSQL database, and Redis cache.
yaml
version: '3.8'
services:
app:
image: retailcoder/oms:latest
build:
context: .
dockerfile: Dockerfile.prod
ports:
- "3000:3000"
env_file: .env
restart: always
depends_on:
- db
- redis
db:
image: postgres:15-alpine
volumes:
- pgdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USER}
POSTGRES_PASSWORD: ${DB_PASS}
POSTGRES_DB: oms
redis:
image: redis:alpineStart Services#
bash
docker-compose -f docker-compose.prod.yml up -d
Reverse ProxyWe recommend placing Nginx or Traefik in front of the container to handle SSL termination (HTTPS) and load balancing.