This guide uses Docker Compose to run Hexo in containers.
For Docker installation, see Docker.
Build the static output locally using the CLI.
Create a simple Nginx container to serve the generated files.
cat <<'YAML' > docker-compose.yml
services:
web:
image: nginx:alpine
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./public:/usr/share/nginx/html:ro
YAML
docker compose up -d
Deploying Hexo in containers for production? Our consulting covers:
Get expert help: office@linux-server-admin.com | Contact Page