forked from polyphony-chat/symfonia
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (33 loc) · 849 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
FROM rust:1-bookworm AS chef
RUN cargo install cargo-chef
RUN update-ca-certificates
WORKDIR /app
FROM chef AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM chef AS builder
COPY --from=planner /app/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
COPY . .
RUN SQLX_OFFLINE=true cargo build --release
FROM debian:latest AS runtime
# API
EXPOSE 3001
# CDN
EXPOSE 3002
# Gateway
EXPOSE 3003
EXPOSE 3003/udp
RUN apt update && apt install -y libssl-dev pkg-config
RUN adduser \
--disabled-password \
--gecos "" \
--home "/nonexistent" \
--shell "/sbin/nologin" \
--no-create-home \
--uid 10001 \
"symfonia"
COPY --from=builder --chown=symfonia:symfonia /app/target/release/symfonia /app/symfonia
USER symfonia:symfonia
WORKDIR /app/
ENTRYPOINT ["/app/symfonia"]