Files
poimen-memory/Dockerfile
T
Story Crater Bot b63b9792f4
Build and Push / Test (push) Successful in 2m50s
Build and Push / Build and push image (push) Failing after 1m20s
fix(ci): use rust:1-slim-bookworm (latest stable, needs 1.88+)
2026-08-23 17:58:41 -07:00

52 lines
1.1 KiB
Docker

# Build stage
FROM rust:1-slim-bookworm AS builder
WORKDIR /app
# Install build dependencies
RUN apt-get update && apt-get install -y \
pkg-config \
libssl-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy manifests and source
COPY Cargo.toml Cargo.lock ./
RUN mkdir -p src && echo '// workspace root' > src/lib.rs
COPY crates ./crates
# Build release binary
RUN cargo build --release -p mem-cli --bin mem
# Runtime stage
FROM debian:bookworm-slim
WORKDIR /app
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
ca-certificates \
libssl3 \
&& rm -rf /var/lib/apt/lists/*
# Copy binary from builder
COPY --from=builder /app/target/release/mem /usr/local/bin/mem
# Copy templates and queries
COPY templates ./templates
COPY queries ./queries
# Create non-root user
RUN useradd -r -u 1000 memuser
USER memuser
# Default port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Default command: start HTTP server
ENTRYPOINT ["mem"]
CMD ["serve", "--port", "8080"]