Skip to main content

Deployment

The Showcase website is deployed as a Docker container, often alongside the rest of the stack, but it can be standalone.

Docker Strategy

We use a Multi-stage Build to keep the image light (standalone output of Next.js).

The Migration Sidecar

One particularity of this project is the migrate service in docker-compose.yml.

migrate:
command: ["npx", "prisma", "db", "push"]
restart: "no"
  • Why?: We use prisma db push instead of migrate deploy because we are often in prototyping mode for the blog schema.
  • Workflow:
    1. The migrate container starts.
    2. It pushes the schema to MariaDB.
    3. It exits with code 0.
    4. The web container waits for migrate to complete successfully before starting.

Environment Variables

VariableDescription
DATABASE_URLConnection string to MariaDB (mysql://...)
SMTP_HOSTMail server (e.g., smtp.gmail.com)
SMTP_USEREmail address for sending contact forms
NEXT_PUBLIC_ACKEE_DOMAINURL of the Ackee instance