-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (27 loc) · 809 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
FROM rust:1.71 as build
# create a new empty shell project
RUN USER=root cargo new --bin kennzd
WORKDIR /kennzd
# copy over your manifests
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
COPY ./rust-toolchain.toml ./rust-toolchain.toml
# this build step will cache your dependencies
RUN cargo build --release
RUN rm src/*.rs
# copy your source tree
COPY ./src ./src
COPY ./resources ./resources
# build for release
RUN rm ./target/release/deps/kennzd*
RUN cargo build --release
RUN cargo test --release
# our final base
FROM debian:bullseye
# copy the build artifact from the build stage
COPY --from=build /kennzd/target/release/kennzd .
COPY ./templates ./templates
# set the startup command to run your binary
#ENV ROCKET_LOG_LEVEL=normal
ENV ROCKET_ADDRESS="0.0.0.0"
CMD ["./kennzd"]