Add a nice optimized dockerfile for deployment
This commit is contained in:
parent
70f9733112
commit
2062f0bb89
|
@ -0,0 +1,18 @@
|
||||||
|
FROM rust:1.72
|
||||||
|
|
||||||
|
RUN USER=root cargo new --bin nederlandskie
|
||||||
|
WORKDIR /nederlandskie
|
||||||
|
|
||||||
|
COPY ./Cargo.lock ./Cargo.lock
|
||||||
|
COPY ./Cargo.toml ./Cargo.toml
|
||||||
|
|
||||||
|
RUN cargo build --release
|
||||||
|
RUN rm src/*.rs
|
||||||
|
|
||||||
|
COPY ./src ./src
|
||||||
|
|
||||||
|
RUN rm ./target/release/deps/nederlandskie*
|
||||||
|
RUN cargo build --release
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
CMD ["./target/release/nederlandskie"]
|
Loading…
Reference in New Issue