initial commit
This commit is contained in:
39
alpine.Dockerfile
Normal file
39
alpine.Dockerfile
Normal file
@@ -0,0 +1,39 @@
|
||||
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 && touch /home/rust/src/src/main.rs
|
||||
|
||||
RUN sudo chown -R rust:rust .
|
||||
|
||||
RUN cargo fetch
|
||||
RUN cargo build --release || true
|
||||
|
||||
RUN rm -f /home/rust/src/src/main.rs
|
||||
COPY src /home/rust/src/src
|
||||
|
||||
#COPY pre-main.rs /home/rust/src
|
||||
#COPY add-Cargo.toml /home/rust/src\
|
||||
#RUN mv /home/rust/src/src/main.rs /home/rust/src/tmp-main.rs &&\
|
||||
# cat /home/rust/src/pre-main.rs > /home/rust/src/src/main.rs &&\
|
||||
# cat /home/rust/src/tmp-main.rs >> /home/rust/src/src/main.rs &&\
|
||||
# echo >> /home/rust/src/Cargo.toml &&\
|
||||
# cat /home/rust/src/add-Cargo.toml >> /home/rust/src/Cargo.toml
|
||||
|
||||
#RUN sudo apt-get update && sudo apt-get install -y autogen automake git make
|
||||
|
||||
RUN cargo build --release
|
||||
|
||||
FROM alpine:3.10
|
||||
|
||||
RUN mkdir /app
|
||||
COPY static /app/static
|
||||
COPY templates /app/templates
|
||||
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/qchgk_web /app/qchgk_web
|
||||
RUN ls -lsha /app/qchgk_web
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
EXPOSE 8088/tcp
|
||||
|
||||
CMD /app/qchgk_web
|
Reference in New Issue
Block a user