Files
rust-imspyder/Dockerfile
lychang a4be88e901 add .gitlab-ci.yml
add Dockerfile
2024-01-12 04:21:33 +08:00

20 lines
423 B
Docker

FROM rust:1.50 as builder
WORKDIR /app
ARG APP=imspyder
RUN USER=root cargo new $APP
WORKDIR /app/$APP
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 alpine:latest
RUN mkdir -p /cache
COPY --from=builder /usr/local/cargo/bin/$APP /$APP
USER 1000
ENTRYPOINT ["/$APP"]