-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (28 loc) · 962 Bytes
/
Copy pathDockerfile
File metadata and controls
39 lines (28 loc) · 962 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
# ==========================================
# Stage 1: Build Environment (Linux Compiler)
# ==========================================
FROM ubuntu:24.04 AS builder
ENV DEBIAN_FRONTEND=noninteractive
# Install g++, CMake, and Ninja
RUN apt-get update && apt-get install -y \
g++ \
cmake \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspace
# Copy everything from your Windows folder into the container
COPY . .
# Run CMake and build the database
RUN cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release && \
cmake --build build && \
cd build && ctest --output-on-failure
# ==========================================
# Stage 2: Minimal Runtime (Production-grade)
# ==========================================
FROM ubuntu:24.04
WORKDIR /app
# Copy ONLY the compiled Linux binary away from the compiler layers
COPY --from=builder /workspace/build/KV_Database .
EXPOSE 6625
VOLUME ["/app/data"]
CMD ["./KV_Database"]