rave/Dockerfile
2023-10-10 21:25:02 +03:00

29 lines
560 B
Docker

# --- Build ---
FROM clux/muslrust:latest AS build
COPY Cargo.toml Cargo.lock /volume/
RUN mkdir -p /volume/src && touch /volume/src/lib.rs
RUN cargo fetch --locked
RUN cargo build --release
RUN rm -rfv /volume/src/*.rs
COPY . .
RUN rm -rfv /volume/target/*/release/rave
ENV DATABASE_URL='sqlite:/config/users.db'
RUN cargo build --release --features docker
RUN mv target/*-unknown-linux-musl/release/rave /tmp/rave
# --- Runtime ---
FROM gcr.io/distroless/static AS runtime
COPY --from=build /tmp/rave /rave
ENV RUST_LOG=info
ENTRYPOINT ["/rave"]