diff --git a/Dockerfile b/Dockerfile index 2abd17b..67cf680 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,7 @@ RUN --mount=type=cache,target=/usr/local/cargo,from=rust:latest,source=/usr/loca # Runtime image FROM debian:bookworm-slim -RUN apt-get update -y && apt-get install -y ca-certificates fuse3 sqlite3 && \ +RUN apt-get update -y && apt-get install -y ca-certificates && \ apt-get clean autoclean && \ apt-get autoremove --yes && \ rm -rf /var/lib/{apt,dpkg,cache,log}/ @@ -25,10 +25,10 @@ WORKDIR /app # Get compiled binaries from builder's cargo install directory COPY --from=builder /usr/src/app/gabrielsimmerdotcom /app/gabrielsimmerdotcom -COPY litefs.yml /etc -COPY --from=flyio/litefs:0.5 /usr/local/bin/litefs /usr/local/bin/litefs COPY --from=builder /usr/src/app/posts/ /app/posts/ COPY --from=builder /usr/src/app/assets/ /app/assets/ COPY --from=builder /usr/src/app/dhall/ /app/dhall -ENTRYPOINT litefs mount \ No newline at end of file +EXPOSE 8080 + +ENTRYPOINT ["/app/gabrielsimmerdotcom", "--bind", "0.0.0.0:8080"] diff --git a/fly.toml b/fly.toml index f2efe76..951c8fc 100644 --- a/fly.toml +++ b/fly.toml @@ -12,7 +12,3 @@ primary_region = "lhr" auto_stop_machines = false auto_start_machines = true processes = ["app"] - -[mounts] - source = "litefs" - destination = "/var/lib/litefs" diff --git a/litefs.yml b/litefs.yml deleted file mode 100644 index 6b5f1ce..0000000 --- a/litefs.yml +++ /dev/null @@ -1,49 +0,0 @@ -# The fuse section describes settings for the FUSE file system. This file system -# is used as a thin layer between the SQLite client in your application and the -# storage on disk. It intercepts disk writes to determine transaction boundaries -# so that those transactions can be saved and shipped to replicas. -fuse: - dir: "/litefs" - -# The data section describes settings for the internal LiteFS storage. We'll -# mount a volume to the data directory so it can be persisted across restarts. -# However, this data should not be accessed directly by the user application. -data: - dir: "/var/lib/litefs" - -# This flag ensure that LiteFS continues to run if there is an issue on starup. -# It makes it easy to ssh in and debug any issues you might be having rather -# than continually restarting on initialization failure. -exit-on-error: false - -# This section defines settings for the option HTTP proxy. -# This proxy can handle primary forwarding & replica consistency -# for applications that use a single SQLite database. -proxy: - addr: ":8080" - target: "localhost:8081" - db: "db" - passthrough: - - "*.ico" - - "*.png" - -# This section defines a list of commands to run after LiteFS has connected -# and sync'd with the cluster. You can run multiple commands but LiteFS expects -# the last command to be long-running (e.g. an application server). When the -# last command exits, LiteFS is shut down. -exec: - - cmd: "/app/gabrielsimmerdotcom --bind 0.0.0.0:8081 --database-path=/litefs/db" - -# The lease section specifies how the cluster will be managed. We're using the -# "consul" lease type so that our application can dynamically change the primary. -# -# These environment variables will be available in your Fly.io application. -lease: - type: "consul" - advertise-url: "http://${HOSTNAME}.vm.${FLY_APP_NAME}.internal:20202" - candidate: ${FLY_REGION == PRIMARY_REGION} - promote: true - - consul: - url: "${FLY_CONSUL_URL}" - key: "litefs/${FLY_APP_NAME}" diff --git a/src/main.rs b/src/main.rs index 19e965b..213f89b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -47,8 +47,6 @@ struct Peer { #[derive(Parser)] struct Cli { - #[arg(short, long, default_value_t=("gs.db").to_string())] - database_path: String, #[arg(short, long, default_value_t=("0.0.0.0:3000").to_string())] bind: String, #[arg(short, long)]