first commit

This commit is contained in:
think.overdrive
2026-01-14 16:24:37 +01:00
commit 94332450aa
18 changed files with 6021 additions and 0 deletions

30
consumer/Dockerfile Normal file
View File

@@ -0,0 +1,30 @@
#FROM lukemathwalker/cargo-chef:latest-rust-1.91.1-alpine3.22 AS chef
#FROM rust:1.91.1-alpine3.22 AS chef
FROM clux/muslrust:stable AS chef
USER root
RUN cargo install cargo-chef
WORKDIR /app
FROM chef AS planner
COPY ./Cargo.toml ./
COPY ./Cargo.lock ./
COPY ./src ./src
ENV RUST_BACKTRACE=1
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
ENV RUST_BACKTRACE=1
RUN cargo chef cook --release --target x86_64-unknown-linux-musl --recipe-path recipe.json
COPY . .
RUN cargo build --release --target x86_64-unknown-linux-musl --bin atlas_consumer
FROM alpine:3.22 AS runtime
RUN addgroup -S station && adduser -S station -G station
WORKDIR /app
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/atlas_consumer /usr/local/bin/
#RUN chown station: /app/atlas_producer && chmod u+x /usr/local/bin/atlas_producer
RUN chown -R station: /app
RUN chmod og+rx /usr/local/bin/atlas_consumer
USER station
ENTRYPOINT ["/usr/local/bin/atlas_consumer"]