Compare commits

...

2 Commits

Author SHA1 Message Date
7f569629db chore: change the default logging directives to be more useful 2026-04-02 00:11:49 -04:00
b3936a79b6 chore: Dockerize 2026-04-02 00:11:23 -04:00
3 changed files with 38 additions and 1 deletions

2
.dockerignore Normal file
View File

@@ -0,0 +1,2 @@
/target
.history/

35
Dockerfile Normal file
View File

@@ -0,0 +1,35 @@
ARG RUST_TAG=1.94.1-alpine3.23
FROM rust:${RUST_TAG} AS builder
ARG BUILD_BASE_VERSION=0.5-r3
RUN --mount=type=cache,sharing=locked,target=/var/cache/apk \
apk add --update build-base=${BUILD_BASE_VERSION}
ARG CMAKE_VERSION=4.1.3-r0
RUN --mount=type=cache,sharing=locked,target=/var/cache/apk \
apk add --update cmake=${CMAKE_VERSION}
ARG PROTOC_VERSION=31.1-r1
RUN --mount=type=cache,sharing=locked,target=/var/cache/apk \
apk add --update protoc=${PROTOC_VERSION}
RUN \
# This one would be nice if it worked:
# --mount=type=bind,source=.,target=/root/app \
# Use this one if there's a hard to track down "read-only filesystem" error:
--mount=type=bind,source=.,target=/root/app,rw \
# --mount=type=bind,source=./target,target=/root/app/target,rw \
--mount=type=cache,sharing=private,target=/root/app/target \
# --mount=type=cache,sharing=private,target=/root/app/target,uid=1000,gid=1000 \
--mount=type=cache,target=/usr/local/cargo/git/db \
--mount=type=cache,target=/usr/local/cargo/registry/ \
cd /root/app && \
cargo build --release && \
cp target/release/fomo-reducer /root/program
FROM scratch AS runner
COPY --from=builder /root/program /program
ENTRYPOINT ["/program"]

View File

@@ -62,7 +62,7 @@ struct AppArgs {
#[derive(Parser)]
struct LoggingArgs {
#[arg(long = "logging-directives", env = "RUST_LOG", default_value = "info")]
#[arg(long = "logging-directives", env = "RUST_LOG", default_value = "warn,fomo_reducer=debug")]
env_filter: EnvFilter,
}