Deploy · Docker

Dockerized deployment

When you opt in to Docker during scaffolding, CEM ships a secure multi-stage Dockerfile and a docker-compose with the correct database sidecar for your ORM choice.

docker-compose.yml

CEM auto-selects the right database image: mongo:7 for Mongoose, or postgres:16-alpine for Prisma / Drizzle.

docker-compose.ymlyaml
services:
  app:
    build: .
    ports:
      - "5000:5000"
    environment:
      - NODE_ENV=production
      - PORT=5000
      - MONGO_URI=mongodb://db:27017/taskflow
    depends_on:
      - db

  db:
    image: mongo:7
    ports:
      - "27017:27017"
    volumes:
      - mongo-data:/data/db

volumes:
  mongo-data:

Package-manager-aware Dockerfile

The generated Dockerfile matches the package manager you scaffolded with — correct lock file, correct install command, and corepack enable for pnpm on Alpine.

bash
PM     Lock file copied      Install command
npm    package-lock.json     npm ci
yarn   yarn.lock             yarn install --frozen-lockfile
pnpm   pnpm-lock.yaml        pnpm install --frozen-lockfile

Launch the stack

bash
docker compose up --build

Your app is exposed at http://localhost:5000 with the database sidecar ready. The Dockerfile uses a multi-stage build so the final image ships only the compiled output plus production dependencies.