mirror of
https://github.com/actix/examples
synced 2024-11-23 22:41:07 +01:00
10887568a0
Signed-off-by: Jérémie Drouet <jeremie.drouet@gmail.com>
25 lines
401 B
Docker
25 lines
401 B
Docker
FROM rust:1-slim-buster AS base
|
|
|
|
ENV USER=root
|
|
|
|
WORKDIR /code
|
|
RUN cargo init
|
|
COPY Cargo.toml /code/Cargo.toml
|
|
RUN cargo fetch
|
|
|
|
COPY src /code/src
|
|
|
|
CMD [ "cargo", "test", "--offline" ]
|
|
|
|
FROM base AS builder
|
|
|
|
RUN cargo build --release --offline
|
|
|
|
FROM rust:1-slim-buster
|
|
|
|
COPY --from=builder /code/target/release/docker_sample /usr/bin/docker_sample
|
|
|
|
EXPOSE 5000
|
|
|
|
ENTRYPOINT [ "/usr/bin/docker_sample" ]
|