-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 887 Bytes
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 887 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
39
40
FROM rust:1.93-bookworm AS builder
WORKDIR /app
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
ca-certificates \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
COPY Cargo.toml Cargo.lock ./
RUN mkdir src \
&& printf 'fn main() {}\n' > src/main.rs
RUN cargo build --release --locked
COPY src ./src
RUN cargo build --release --locked
FROM debian:bookworm-slim
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN groupadd --gid 10001 cachegate \
&& useradd --uid 10001 --gid 10001 --home /app --shell /usr/sbin/nologin cachegate
COPY --from=builder /app/target/release/cachegate /usr/local/bin/cachegate
USER 10001
WORKDIR /app
EXPOSE 8080
ENV RUST_BACKTRACE=1 \
RUST_LOG=INFO
ENTRYPOINT ["cachegate"]
CMD ["--config", "env"]