-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 870 Bytes
/
Dockerfile
File metadata and controls
39 lines (28 loc) · 870 Bytes
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
FROM rust:1.93-bookworm AS builder
WORKDIR /app
# Install build dependencies required for git2 crate
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
cmake \
&& rm -rf /var/lib/apt/lists/*
# Copy manifests
COPY Cargo.toml Cargo.lock ./
# Copy source code
COPY src ./src
# Build for release
RUN cargo build --release
# Use a smaller image for the runtime
FROM debian:bookworm-slim
WORKDIR /app
# Install runtime dependencies (for git HTTPS and SSL)
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
# Copy the compiled binary from the builder environment
COPY --from=builder /app/target/release/rustalink-config-server .
# Expose the server port (as configured in server_config.toml)
EXPOSE 8888
# Command to start the server
CMD ["./rustalink-config-server"]