31 lines
673 B
Docker
31 lines
673 B
Docker
FROM ekidd/rust-musl-builder:1.36.0 as builder
|
|
|
|
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 sudo chown -R rust:rust /home/rust/src/
|
|
|
|
RUN cargo fetch
|
|
RUN cargo build --release
|
|
|
|
RUN rm -f /home/rust/src/src/main.rs
|
|
COPY src /home/rust/src/src
|
|
RUN sudo chown -R rust:rust /home/rust/src/ && \
|
|
touch /home/rust/src/src/main.rs
|
|
|
|
RUN cargo build --release
|
|
|
|
FROM scratch
|
|
|
|
COPY static /static
|
|
COPY templates /templates
|
|
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/qchgk_web /
|
|
|
|
VOLUME /db
|
|
|
|
EXPOSE 8088/tcp
|
|
|
|
ENTRYPOINT ["/qchgk_web"]
|