-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (22 loc) · 716 Bytes
/
Copy pathDockerfile
File metadata and controls
38 lines (22 loc) · 716 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
FROM rust:1.91.1-trixie as builder
WORKDIR /usr/src/
RUN USER=root cargo new anorak
# We want dependencies cached, so copy those first.
COPY Cargo.toml Cargo.lock /usr/src/anorak/
WORKDIR /usr/src/anorak
RUN cargo build --release
COPY src /usr/src/anorak/src/
COPY assets /usr/src/anorak/assets/
## Touch main.rs to prevent cached release build
RUN touch /usr/src/anorak/src/main.rs
RUN cargo build --release
### deploy
# bullseye is required for libssl 1.1.1
FROM debian:trixie-slim
RUN apt-get update && apt-get install -y openssl
COPY --from=builder /usr/src/anorak/target/release/anorak /usr/local/bin/anorak
COPY assets /root/assets/
WORKDIR /root
EXPOSE 9341
ENV RUST_LOG=info
CMD ["anorak"]