Files
furumi-ng/Dockerfile
Ultradesu 85b3cb6852
All checks were successful
Publish Server Image / build-and-push-image (push) Successful in 2m12s
Fixed docker CI
2026-03-17 19:03:48 +00:00

46 lines
1.1 KiB
Docker

# Stage 1: Build the rust binary
FROM rust:1.88.0-bookworm AS builder
# Install supplementary dependencies that might be needed
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
protobuf-compiler \
cmake \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
# Option: Copy in root workspace files and source crates
COPY . .
ARG FURUMI_VERSION=dev
# Build only the server for release
RUN FURUMI_VERSION=${FURUMI_VERSION} cargo build --release --bin furumi-server
# Stage 2: Create the minimal runtime image
FROM debian:bookworm-slim
# Install system dependencies needed at runtime (like OpenSSL if dynamically linked)
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Create a non-root user
RUN useradd -ms /bin/bash appuser
WORKDIR /home/appuser
# Copy the binary from the builder stage
COPY --from=builder /usr/src/app/target/release/furumi-server /usr/local/bin/furumi-server
USER appuser
# Expose ports: 50051 (gRPC) and 9090 (Metrics)
EXPOSE 50051
EXPOSE 9090
# Command to run the server
ENTRYPOINT ["furumi-server"]