Files
simple-object-server/Dockerfile
Your Name ceb31057a9 .
2025-04-30 22:50:41 +12:00

37 lines
755 B
Docker

FROM alpine:latest AS builder
# Install build dependencies
RUN apk add --no-cache \
build-base \
cmake \
git \
musl-dev \
sqlite-dev
# Copy source code
COPY . /src
WORKDIR /src
# Build
RUN mkdir build && cd build && \
cmake .. -DCMAKE_EXE_LINKER_FLAGS="-static" && \
make -j$(nproc)
# Create final image
FROM scratch
# Copy binary from builder
COPY --from=builder /src/build/dropshell_template_registry /dropshell_template_registry
# Create data directory (though mounting is preferred)
# RUN mkdir -p /data
# VOLUME /data
# Set working directory (optional for scratch)
# WORKDIR /data
# Expose port
EXPOSE 80
# Run server (assuming config is mounted at /data/config.json)
ENTRYPOINT ["/dropshell_template_registry"]