Prerequisites

You’ll need a Makeswift site. If you don’t already have one, you can follow the developer quickstart or installation guide to get started.

You’ll also need to use Makeswift runtime version 0.23.2 or higher.

Deploying

Vercel has already documented how to deploy a Next.js application with Docker. The only change you have to make when deploying your Makeswift site is to your environment variables (details below).

Otherwise, you can follow the Next.js with Docker documentation.

Environment variables

You’ll need to include two environment variables in your Docker build: MAKESWIFT_SITE_API_KEY and MAKESWIFT_DRAFT_MODE_PROXY_FORCE_HTTP. These will need to be added in the .env file that is included in your Docker build or in the dashboard of your hosting provider.

MAKESWIFT_SITE_API_KEY=<YOUR_API_KEY>
MAKESWIFT_DRAFT_MODE_PROXY_FORCE_HTTP=true

The MAKESWIFT_DRAFT_MODE_PROXY_FORCE_HTTP flag ensures that requests from Makeswift’s Draft Mode proxy always use HTTP, regardless of whether the original request used HTTP or HTTPS. This prevents SSL errors when forwarding HTTPS requests to servers that only support HTTP, which is common for servers running in Docker containers.

Setting this variable does not affect your external domain, which should always use HTTPS.

Your Makeswift API key can be found in the Makeswift Visual Builder under Settings > Host.