-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (24 loc) · 911 Bytes
/
Dockerfile
File metadata and controls
38 lines (24 loc) · 911 Bytes
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
36
37
38
# ------------------------------------------------------------------------------
# Cargo Build Stage
# ------------------------------------------------------------------------------
FROM rust:1.43 as cargo-build
RUN apt-get update
WORKDIR /usr/src/upsb_four
COPY Cargo.toml Cargo.toml
RUN mkdir src/
RUN echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs
RUN cargo build --release
RUN rm -f target/release/deps/upsb_four*
COPY src ./src
COPY build.rs .
COPY templates ./templates
COPY statics ./statics
RUN cargo build --release
# ------------------------------------------------------------------------------
# Final Stage
# ------------------------------------------------------------------------------
FROM cargo-build
VOLUME ["/data"]
WORKDIR /data
COPY --from=cargo-build /usr/src/upsb_four/target/release/upsb_four /home/upsb_four/bin
CMD ["/home/upsb_four/bin"]