Skip to content

Commit 7f34829

Browse files
author
anon
committed
chore: add Dockerfile
1 parent 870f23c commit 7f34829

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

rust/Dockerfile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
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 --release --bin vss-server
18+
19+
# Runtime stage
20+
FROM debian:bookworm-slim
21+
22+
# Install runtime dependencies
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+
29+
WORKDIR /app
30+
31+
# Copy the compiled binary from builder
32+
COPY --from=builder /build/target/release/vss-server /app/vss-server
33+
34+
# Copy default configuration file
35+
COPY server/vss-server-config.toml /app/vss-server-config.toml
36+
37+
EXPOSE 8080
38+
39+
# Run the server with the config file
40+
CMD ["/app/vss-server", "/app/vss-server-config.toml"]

0 commit comments

Comments
 (0)