Skip to content

Instantly share code, notes, and snippets.

@darklinden
Last active June 12, 2024 02:59
Show Gist options
  • Save darklinden/a217235035419216d2c388631c7b6318 to your computer and use it in GitHub Desktop.
Save darklinden/a217235035419216d2c388631c7b6318 to your computer and use it in GitHub Desktop.
caddyfile for simple file server
# docker-compose.yml
version: "3"
services:
caddy:
image: caddy:2.8-alpine
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- ./site:/usr/share/caddy
# Caddyfile
:80 {
# Set this path to your site's directory.
root * /usr/share/caddy
# Enable the static file server.
file_server browse {
hide @eaDir .DS_Store .git
precompressed zstd br gzip
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment