forked from SOZ-Faut-etre-Sub/ZUMBLE
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
31 lines (19 loc) · 884 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
FROM rust:1.73.0 as builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y git bash make gcc linux-libc-dev patch musl musl-tools musl-dev openssl
RUN rustup target add x86_64-unknown-linux-musl
COPY . /zumble-build
WORKDIR /zumble-build
RUN openssl req -newkey rsa:2048 -new -nodes -x509 -days 3650 -keyout /key.pem -out /cert.pem -subj "/C=FR/ST=Paris/L=Paris/O=SoZ/CN=soz.zerator.com"
RUN --mount=type=cache,target=/usr/local/cargo,from=rust,source=/usr/local/cargo \
--mount=type=cache,target=target \
cargo build --release --target x86_64-unknown-linux-musl && cp target/x86_64-unknown-linux-musl/release/zumble /zumble
FROM scratch
COPY --from=builder /zumble /zumble
COPY --from=builder /cert.pem /cert.pem
COPY --from=builder /key.pem /key.pem
EXPOSE 64738/udp
EXPOSE 64738/tcp
EXPOSE 8080/tcp
ENV RUST_LOG=info
ENTRYPOINT ["/zumble"]