all repos — homestead @ 1b39fef5f4683391da076827a1dba6e31162f0f1

Code for my website

Deploy to fly.io

Alan Pearce
commit

1b39fef5f4683391da076827a1dba6e31162f0f1

parent

f8d8abe77ccce829ac42e988d65530c0bfd98313

5 files changed, 52 insertions(+), 2 deletions(-)

jump to
A .dockerignore
@@ -0,0 +1,3 @@
+* +!Caddyfile +!public
M .envrc.envrc
@@ -1,1 +1,2 @@
use flake +export SITE_ROOT=public
M CaddyfileCaddyfile
@@ -1,5 +1,14 @@
-http:// { - root * public/ +{ + admin off + persist_config off +} + +:9091 { + metrics +} + +:8080 { + root * {$SITE_ROOT} file_server { precompressed br zstd gzip }
A Dockerfile
@@ -0,0 +1,6 @@
+FROM docker.io/caddy:2-alpine + +COPY Caddyfile /etc/caddy/ +COPY public /srv + +EXPOSE 9091/tcp
A fly.toml
@@ -0,0 +1,31 @@
+# fly.toml file generated for alanpearce-eu on 2023-06-30T19:28:33+02:00 + +app = "alanpearce-eu" +kill_signal = "SIGINT" +kill_timeout = 5 +primary_region = "ams" + +[metrics] + port = 9091 + path = "/metrics" + +[env] + SITE_ROOT = "/srv" + +[http_service] + internal_port = 8080 + force_https = true + auto_stop_machines = true + auto_start_machines = true + min_machines_running = 1 + [http_service.concurrency] + type = "requests" + soft_limit = 2000 + hard_limit = 2500 + [[http_service.checks]] + grace_period = "10s" + interval = "30s" + method = "GET" + timeout = "5s" + path = "/" +