-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
47 lines (31 loc) · 909 Bytes
/
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
42
43
44
45
46
47
FROM rust:slim-bookworm AS builder
RUN update-ca-certificates
ENV USER=jitsi-openid
ENV UID=10001
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid "${UID}" \
"${USER}"
RUN apt-get update \
&& apt-get install -y pkg-config libssl-dev
RUN cargo new --bin jitsi-openid
WORKDIR /jitsi-openid
COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml
RUN cargo build --release \
&& rm src/*.rs target/release/deps/jitsi_openid*
COPY ./src ./src
RUN cargo build --release
FROM debian:bookworm-slim
ENV LISTEN_ADDR=0.0.0.0:3000
EXPOSE 3000
COPY --from=builder /etc/passwd /etc/passwd
COPY --from=builder /etc/group /etc/group
WORKDIR /jitsi-openid
COPY --from=builder /jitsi-openid/target/release/jitsi-openid ./jitsi-openid
USER jitsi-openid:jitsi-openid
CMD ["/jitsi-openid/jitsi-openid"]