This commit is contained in:
Your Name
2025-04-30 22:32:17 +12:00
parent ce82cbc819
commit 4be22e1f48
5 changed files with 222 additions and 5016 deletions

View File

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