Completely remove litefs
All checks were successful
Fly Deploy / Deploy app (push) Successful in 59s
All checks were successful
Fly Deploy / Deploy app (push) Successful in 59s
This commit is contained in:
parent
fb5708af55
commit
10b6b8051e
|
@ -16,7 +16,7 @@ RUN --mount=type=cache,target=/usr/local/cargo,from=rust:latest,source=/usr/loca
|
||||||
# Runtime image
|
# Runtime image
|
||||||
FROM debian:bookworm-slim
|
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 clean autoclean && \
|
||||||
apt-get autoremove --yes && \
|
apt-get autoremove --yes && \
|
||||||
rm -rf /var/lib/{apt,dpkg,cache,log}/
|
rm -rf /var/lib/{apt,dpkg,cache,log}/
|
||||||
|
@ -25,10 +25,10 @@ WORKDIR /app
|
||||||
|
|
||||||
# Get compiled binaries from builder's cargo install directory
|
# Get compiled binaries from builder's cargo install directory
|
||||||
COPY --from=builder /usr/src/app/gabrielsimmerdotcom /app/gabrielsimmerdotcom
|
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/posts/ /app/posts/
|
||||||
COPY --from=builder /usr/src/app/assets/ /app/assets/
|
COPY --from=builder /usr/src/app/assets/ /app/assets/
|
||||||
COPY --from=builder /usr/src/app/dhall/ /app/dhall
|
COPY --from=builder /usr/src/app/dhall/ /app/dhall
|
||||||
|
|
||||||
ENTRYPOINT litefs mount
|
EXPOSE 8080
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app/gabrielsimmerdotcom", "--bind", "0.0.0.0:8080"]
|
||||||
|
|
4
fly.toml
4
fly.toml
|
@ -12,7 +12,3 @@ primary_region = "lhr"
|
||||||
auto_stop_machines = false
|
auto_stop_machines = false
|
||||||
auto_start_machines = true
|
auto_start_machines = true
|
||||||
processes = ["app"]
|
processes = ["app"]
|
||||||
|
|
||||||
[mounts]
|
|
||||||
source = "litefs"
|
|
||||||
destination = "/var/lib/litefs"
|
|
||||||
|
|
49
litefs.yml
49
litefs.yml
|
@ -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}"
|
|
|
@ -47,8 +47,6 @@ struct Peer {
|
||||||
|
|
||||||
#[derive(Parser)]
|
#[derive(Parser)]
|
||||||
struct Cli {
|
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())]
|
#[arg(short, long, default_value_t=("0.0.0.0:3000").to_string())]
|
||||||
bind: String,
|
bind: String,
|
||||||
#[arg(short, long)]
|
#[arg(short, long)]
|
||||||
|
|
Loading…
Reference in a new issue