Skip to content

Commit dad2058

Browse files
author
fmar
committed
chore: add Dockerfile
1 parent 56be2d9 commit dad2058

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

rust/Dockerfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
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+
# Environment variables for PostgreSQL connection
38+
#ENV VSS_POSTGRESQL_USERNAME=postgres
39+
#ENV VSS_POSTGRESQL_PASSWORD=YOU_MUST_CHANGE_THIS_PASSWORD
40+
#ENV VSS_POSTGRESQL_HOST=postgres
41+
#ENV VSS_POSTGRESQL_PORT=5432
42+
#ENV VSS_POSTGRESQL_DATABASE=postgres
43+
44+
EXPOSE 8080
45+
46+
# Run the server with the config file
47+
CMD ["/app/vss-server", "/app/vss-server-config.toml"]

0 commit comments

Comments
 (0)