qchgk_web_docker/Dockerfile
Dmitry 891a4bced1
Some checks failed
continuous-integration/drone/push Build is failing
rm chown and volume
2023-03-28 19:19:27 +03:00

32 lines
672 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/x86_64-unknown-linux-musl/release/qchgk_web /
EXPOSE 8088/tcp
ENTRYPOINT ["/qchgk_web"]