Docker & Portainer
Build
docker build -t magic-labs .
The dockerfile at the repo root handles the Next.js production build.
Persistent volume
public/assets/uploads/ must be mounted as a persistent volume — uploaded files are written here at runtime and are NOT in the image.
In docker-compose.yml:
volumes:
- uploads:/app/public/assets/uploads
Without this, uploaded files are lost on every container restart.
nginx
Config lives in nginx/ — handles proxying to the Next.js container.
Environment variables
Set all env vars in Portainer (stack environment variables), not in .env files committed to git.
See Environment Variables for the full list.