···3535RUN mkdir /app/data
3636COPY conf/supervisord.conf /app/supervisord.conf
3737COPY conf/Caddyfile /app/Caddyfile
3838-RUN caddy adapt -c Caddyfile -p >/app/caddy.json
3938COPY conf/config.toml.example /app/config.toml
40394140# Caddy ports:
4242-EXPOSE 80 443 2019
4141+EXPOSE 80/tcp 443/tcp 443/udp 2019/tcp
4342# git-pages ports:
4444-EXPOSE 3000 3001 3002
4343+EXPOSE 3000/tcp 3001/tcp 3002/tcp
45444645# While the default command is to run git-pages standalone, the intended configuration
4746# is to use it with Caddy and store both site data and credentials to an S3-compatible
+22-8
conf/Caddyfile
···4040 protocols h1 h2
4141 }
42424343+ servers {$UDP_BIND_TO:0.0.0.0}:443 {
4444+ name http3
4545+ protocols h3
4646+ }
4747+4348 servers :2002 {
4449 name health
4550 protocols h1
4651 }
4752}
48534949-(backend_pages) {
5454+(backend) {
5555+ tls {
5656+ on_demand
5757+ }
5858+5059 @h2c `{env.FEATURES}.matches(r"\bh2c\b")`
5160 reverse_proxy @h2c h2c://{$GIT_PAGES_ADDRESS:localhost}:3000
5261 reverse_proxy http://{$GIT_PAGES_ADDRESS:localhost}:3000
6262+6363+ header Alt-Svc `h3=":443"; persist=1, h2=":443"; persist=1`
6464+ encode
5365}
54665567http:// {
6868+ # initial PUT/POST for a new domain has to happen over HTTP
5669 @get method GET
5770 redir @get https://{host}{uri} 301
58715959- # initial PUT/POST for a new domain has to happen over HTTP
6060- import backend_pages
7272+ import backend
6173}
62746375https:// {
6464- tls {
6565- on_demand
6666- }
7676+ import backend
7777+}
7878+7979+https:// {
8080+ # Fly.io requires UDP sockets to be bound to a different IP
8181+ bind {$UDP_BIND_TO:0.0.0.0}
67826868- encode
6969- import backend_pages
8383+ import backend
7084}
71857286http://localhost:2002 {
+1-1
conf/supervisord.conf
···1212command = /bin/git-pages
13131414[program:caddy]
1515-command = /bin/caddy run -c caddy.json
1515+command = /bin/caddy run
1616depends_on = pages
+9
fly.toml
···1717memory = 512
18181919[env]
2020+UDP_BIND_TO = "fly-global-services"
2021AUTOMEMLIMIT = "0.25"
21222223[[files]]
···3334[[services]]
3435internal_port = 443
3536protocol = "tcp"
3737+ports = [{ port = 443 }]
3838+auto_stop_machines = "stop"
3939+auto_start_machines = true
4040+4141+# NB: Fly.io does not support UDP on public IPv6
4242+[[services]]
4343+internal_port = 443
4444+protocol = "udp"
3645ports = [{ port = 443 }]
3746auto_stop_machines = "stop"
3847auto_start_machines = true