qchgk_web_docker/Dockerfile
Dmitry e7d4a18d3e
All checks were successful
continuous-integration/drone/push Build is passing
target path
2023-03-28 19:29:18 +03:00

32 lines
646 B
Docker

FROM rustlang/rust:nightly-alpine as builder
ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL sparse
RUN apk add --no-cache musl-dev
WORKDIR /home/rust/src
COPY Cargo.toml /home/rust/src/
COPY Cargo.lock /home/rust/src/
RUN mkdir /home/rust/src/src && \
echo 'fn main() {}' > /home/rust/src/src/main.rs
RUN cargo fetch
RUN cargo build --release
RUN rm -f /home/rust/src/src/main.rs
COPY src /home/rust/src/src
RUN touch /home/rust/src/src/main.rs
RUN cargo build -v --release
FROM scratch
COPY static /static
COPY templates /templates
COPY --from=builder /home/rust/src/target/release/qchgk_web /
EXPOSE 8088/tcp
ENTRYPOINT ["/qchgk_web"]