-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (27 loc) · 1.05 KB
/
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
36
37
38
39
40
41
# ------------------------------------------------------------------------------
# Cargo Build Stage
# ------------------------------------------------------------------------------
FROM rust:1.46.0 AS builder
WORKDIR /app
COPY Cargo.lock Cargo.lock
COPY Cargo.toml Cargo.toml
RUN mkdir src/
RUN mkdir src/bin
RUN touch src/lib.rs
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/*watcher*
RUN rm -f target/release/deps/*staking*
RUN rm -rf src
COPY . .
RUN cargo build --release
# # ------------------------------------------------------------------------------
# # Final Stage
# # ------------------------------------------------------------------------------
FROM debian:buster-slim
RUN apt-get update && apt-get install -y libssl-dev ca-certificates
RUN update-ca-certificates --fresh
WORKDIR /app
COPY --from=builder /app/target/release/watcher-claimed-payouts /usr/local/bin
COPY config/config.yml ./config/config.yml
CMD ["/usr/local/bin/watcher-claimed-payouts"]