File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ target /
Original file line number Diff line number Diff line change 1+ # Build stage
2+ FROM rust:1.91-bookworm AS builder
3+
4+ WORKDIR /build
5+
6+ # Copy workspace files
7+ COPY Cargo.toml Cargo.lock ./
8+ COPY rustfmt.toml ./
9+
10+ # Copy all workspace members
11+ COPY server ./server
12+ COPY api ./api
13+ COPY impls ./impls
14+ COPY auth-impls ./auth-impls
15+
16+ # Build the application in release mode
17+ RUN cargo build --locked --release --bin vss-server
18+
19+ # Runtime stage
20+ FROM debian:bookworm-slim
21+
22+ # Install runtime dependencies and create an unprivileged runtime user
23+ RUN apt-get update && \
24+ apt-get install -y --no-install-recommends \
25+ ca-certificates \
26+ libssl3 \
27+ && rm -rf /var/lib/apt/lists/* \
28+ && groupadd --system vss \
29+ && useradd --system --gid vss --home-dir /app --shell /usr/sbin/nologin vss \
30+ && mkdir -p /app \
31+ && chown vss:vss /app
32+
33+ WORKDIR /app
34+
35+ # Copy the compiled binary from builder
36+ COPY --from=builder --chown=vss:vss /build/target/release/vss-server /app/vss-server
37+
38+ # Copy default configuration file
39+ COPY --chown=vss:vss server/vss-server-config.toml /app/vss-server-config.toml
40+
41+ USER vss:vss
42+
43+ ENV VSS_BIND_ADDRESS=0.0.0.0:8080
44+
45+ EXPOSE 8080
46+
47+ # Run the server with the config file
48+ CMD ["/app/vss-server" , "/app/vss-server-config.toml" ]
You can’t perform that action at this time.
0 commit comments