-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (25 loc) · 763 Bytes
/
Dockerfile
File metadata and controls
31 lines (25 loc) · 763 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
FROM rust:latest AS builder
WORKDIR /usr/src/app
COPY Cargo.toml Cargo.lock ./
RUN \
mkdir -v src && \
echo "fn main() {println!(\"Building dependencies...\");}" > src/main.rs && \
# debug build
# cargo build && \
cargo build --release && \
rm -Rvf src
COPY src ./src
COPY regexes.yaml ./regexes.yaml
RUN \
touch src/main.rs && \
# debug build
# cargo build
cargo build --release
FROM debian:trixie-slim
RUN apt-get update && \
apt-get install -y ca-certificates && \
rm -rf /var/lib/apt/lists/*
# debug build
# COPY --from=builder /usr/src/app/target/debug/urlshortener /usr/local/bin/urlshortener
COPY --from=builder /usr/src/app/target/release/urlshortener /usr/local/bin/urlshortener
CMD ["urlshortener"]