- Portability — move between hosting environments without reconfiguring build tools
- Scalability — deploy to Heroku, Amazon ECS, Google Cloud Run, or any OCI-compatible runtime
- Security — isolated build environment with no host dependencies
Step 1: Add a Dockerfile
Create aDockerfile at the root of your project. The following example uses a multi-stage build: the first stage installs Retype and builds the site, and the second stage produces a minimal Apache HTTP server image containing only the built output.
Dockerfile
Most cloud platforms (Heroku, ECS, Cloud Run) can build the Docker image on their own from the
Dockerfile. Consult your platform’s documentation for details — you may not need to build or push the image manually.Step 2: Build the image
Build the image locally using the Docker CLI:Step 3: Publish the image
After a successful local build, push the image to a container registry. Docker Hub provides free public repositories:Using Docker in CI/CD
You can integrate the Docker build into a GitHub Actions workflow to automatically build and publish the image on every push:.github/workflows/docker-publish.yml
DOCKER_USERNAME and DOCKER_PASSWORD).
Other hosting options
GitHub Pages
Deploy to GitHub Pages for free using the Retype Build Action.
Netlify
Deploy to Netlify with automatic builds from your Git repository.
Cloudflare Pages
Host on Cloudflare Pages with global CDN and DDoS protection.
