You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
580 B

ARG BUILD_TAG=1.56.1
ARG RUN_TAG=alpine
#$BUILD_TAG
FROM rust:$BUILD_TAG as builder
WORKDIR /usr/src/
RUN USER=root cargo new --bin free_id
WORKDIR /usr/src/free_id
# Compile dependencies
COPY Cargo.toml Cargo.lock ./
RUN cargo build --locked --release
# Remove bins to make sure we rebuild
# hadolint ignore=DL3059
RUN rm ./target/release/deps/free_id*
COPY src ./src
RUN cargo build --release
FROM rust:$RUN_TAG
WORKDIR /app
COPY --from=builder /usr/src/free_id/target/release/free_id /usr/local/bin/
EXPOSE 8000
ENV ROCKET_ADDRESS=0.0.0.0
CMD ["/usr/local/bin/free_id"]