Docker Addon

The Docker addon adds containerized deployment support to your project.

What it includes

  • Dockerfile — multi-stage build for Phoenix + SvelteKit
  • docker-compose.yml — local development with PostgreSQL
  • .dockerignore — optimized build context
  • Makefile targets for Docker operations

Local development with Docker

Start the full stack with Docker Compose:

docker compose up

This starts:

  • PostgreSQL on port 5432
  • Phoenix on port 4000
  • SvelteKit dev server on port 5173

Production build

Build the production image:

docker build -t my-app .

The multi-stage Dockerfile:

  1. Installs Elixir and Node.js dependencies
  2. Builds the SvelteKit client to static assets
  3. Compiles the Phoenix release
  4. Creates a minimal runtime image

Disabling the addon

If you’re deploying without containers:

npx tostada-cli create MyApp -docker

This removes the Dockerfile, docker-compose.yml, .dockerignore, and related Makefile targets.