-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (30 loc) · 929 Bytes
/
Dockerfile
File metadata and controls
42 lines (30 loc) · 929 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
40
41
42
# Multi-stage build for mcpls
# Build stage uses rust:1.85-slim, runtime uses debian:bookworm-slim
# Build stage
FROM rust:1.85-slim as builder
WORKDIR /app
# Copy workspace files
COPY Cargo.toml Cargo.lock ./
COPY crates/ ./crates/
# Build release binary
RUN cargo build --release --package mcpls
# Runtime stage
FROM debian:bookworm-slim
# Install runtime dependencies (CA certificates for HTTPS)
RUN apt-get update && apt-get install -y \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Copy only the binary from builder stage
COPY --from=builder /app/target/release/mcpls /usr/local/bin/mcpls
# Create config directory
RUN mkdir -p /etc/mcpls
# Set default environment variables
ENV MCPLS_CONFIG=/etc/mcpls/mcpls.toml
ENV MCPLS_LOG=info
# Run as non-root user for security
RUN useradd -m -u 1000 mcpls && \
chown -R mcpls:mcpls /etc/mcpls
USER mcpls
WORKDIR /home/mcpls
ENTRYPOINT ["mcpls"]
CMD []