forked from framp/discord-telegram-simple-relay
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
23 lines (17 loc) · 706 Bytes
/
Copy pathDockerfile
File metadata and controls
23 lines (17 loc) · 706 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
FROM rust:1.73-bookworm as builder
WORKDIR /usr/src/app
COPY . .
# Will build and cache the binary and dependent crates in release mode
RUN --mount=type=cache,target=/usr/local/cargo,from=rust:latest,source=/usr/local/cargo \
--mount=type=cache,target=target \
cargo build --release && mv ./target/release/discord-telegram-simple-relay ./discord-telegram-simple-relay
# Runtime image
FROM debian:bookworm-slim
# Run as "app" user
RUN useradd -ms /bin/bash app
USER app
WORKDIR /app
# Get compiled binaries from builder's cargo install directory
COPY --from=builder /usr/src/app/discord-telegram-simple-relay /app/discord-telegram-simple-relay
# Run the app
CMD ./discord-telegram-simple-relay