diff --git a/static/Caddyfile b/static/Caddyfile new file mode 100644 index 0000000..87b0032 --- /dev/null +++ b/static/Caddyfile @@ -0,0 +1,13 @@ +{ + # fly.io handles HTTPS for us + auto_https off +} + +http://static-mat-services.fly.dev/ { + redir https://mat.services/ +} + +:8080 { + root * /var/www + file_server +} \ No newline at end of file diff --git a/static/Dockerfile b/static/Dockerfile new file mode 100644 index 0000000..b14a44a --- /dev/null +++ b/static/Dockerfile @@ -0,0 +1,13 @@ +FROM nixos/nix:latest + +WORKDIR /code +RUN nix \ + --extra-experimental-features nix-command \ + --extra-experimental-features flakes \ + build git+https://git.mat.services/mat/mat.services + +FROM caddy:latest + +COPY Caddyfile /etc/caddy/Caddyfile +COPY --from=0 /code/result /var/www +RUN caddy \ No newline at end of file diff --git a/static/fly.toml b/static/fly.toml new file mode 100644 index 0000000..6016db0 --- /dev/null +++ b/static/fly.toml @@ -0,0 +1,38 @@ +# fly.toml file generated for static-mat-services on 2022-08-08T01:01:25-04:00 + +app = "static-mat-services" +kill_signal = "SIGINT" +kill_timeout = 5 +processes = [] + +[[env]] + +[experimental] + allowed_public_ports = [] + auto_rollback = true + +[[services]] + http_checks = [] + internal_port = 8080 + processes = ["app"] + protocol = "tcp" + script_checks = [] + [services.concurrency] + hard_limit = 25 + soft_limit = 20 + type = "connections" + + [[services.ports]] + force_https = true + handlers = ["http"] + port = 80 + + [[services.ports]] + handlers = ["tls", "http"] + port = 443 + + [[services.tcp_checks]] + grace_period = "1s" + interval = "15s" + restart_limit = 0 + timeout = "2s"