Static Files Deployment
Detection
Project is static if:
index.htmlexists in the root- Or
Staticfileexists at the project root (explicit configuration)
Configuration
Root Directory
Staticfilecontents:root: <dir>- Default: current directory (
.)
Staticfile
Create a Staticfile at the project root:
root: dist
Custom Caddyfile
Place a Caddyfile at the project root to override the default Caddy configuration.
Typical Layouts
| Layout | Root to serve |
|---|---|
| Built SPA (Vite, etc.) | dist |
| Jekyll / Hugo output | _site or public |
| Plain HTML | . (current dir) |
| Nested | Configure via Staticfile |
Dockerfile Patterns
Nginx
FROM nginx:alpine
COPY . /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Caddy
FROM caddy:alpine
COPY . /srv
EXPOSE 80
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]
With custom Caddyfile
FROM caddy:alpine
COPY Caddyfile /etc/caddy/Caddyfile
COPY dist /srv
EXPOSE 80
CMD ["caddy", "run", "--config", "/etc/caddy/Caddyfile"]