Files
storage/Dockerfile
2025-06-24 02:19:50 +08:00

26 lines
675 B
Docker

FROM rust:1.75 as builder
WORKDIR /app
RUN USER=root cargo new storage
WORKDIR /app/storage
RUN mkdir -p .cargo
COPY config.toml .cargo/
COPY Cargo.toml Cargo.lock ./
COPY ./src src
RUN cargo install --path . --color always
# Copy the app to an base Docker image, here we use distroless
FROM ubuntu:latest
ENV MINIO_REGION ""
ENV MINIO_ENDPOINT http://192.168.1.100:9000
ENV MINIO_ACCESS_KEY pmkSLk5WwyUViV9OxgNg
ENV MINIO_SECRET_KEY 17UxEQZZhNGQmroc4tItq8POlfCATW5Ni3IGljif
RUN apt-get update
RUN apt-get install -y ca-certificates
RUN update-ca-certificates
RUN mkdir -p /cache
COPY --from=builder /usr/local/cargo/bin/storage /storage
USER 1000
ENTRYPOINT ["/storage"]