diff --git a/Dockerfile b/Dockerfile index 83cc5c6..7628c96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,21 @@ -FROM ubuntu +FROM rust:1.59 as builder + +WORKDIR /build + +COPY ./src/ /build/src +COPY ./Cargo.toml /build/Cargo.toml + +RUN rustup update nightly && rustup default nightly && \ + cargo clean && cargo build --release + + +FROM debian:buster-slim + WORKDIR /app -COPY ./target/release/fastcloud /app/fastcloud -COPY ./templates /app/templates - -RUN mkdir /app/templates/service -ENV FASTCLOUD_DIR /app/templates/service +COPY --from=builder /build/target/release/fastcloud /app/fastcloud +RUN mkdir /app/service +COPY ./templates/ /app/templates +ENV FASTCLOUD_DIR /app/service CMD [ "/app/fastcloud" ]