Files
poimen-memory/Dockerfile
rock b15072e12d
CI / CI (push) Successful in 11m36s
fix: resolve 8 integration test compilation errors (#46)
## Problem
8 integration test files failed to compile due to:
1. Ambiguous float types (Rust 2024+ stricter inference)
2. chrono 0.4 API change (`with_hour` removed)
3. Missing `sqlx` + `base64` in `[dev-dependencies]`
4. `<` parsed as generics instead of comparison
5. Incorrect assertion (3^5=243 > 100)

## Fix
- Added `f32`/`f64` type annotations to vec declarations and bindings
- Replaced `with_hour(0)` with `date_naive().and_hms_opt(0,0,0).unwrap().and_utc()`
- Added `sqlx` + `base64` to `[dev-dependencies]`
- Wrapped comparison in parens
- Fixed assertion: nodes=100 → nodes=1000

## Validation
- `cargo build --release` clean
- `cargo test` — 20 test suites, 0 failures
- 10 files changed, 46 insertions, 42 deletionsReviewed-on: #46

Co-authored-by: rock <[email protected]>
2026-09-09 01:22:33 +00:00

42 lines
950 B
Docker

# Multi-stage build for Poimen Memory Service (Rust)
# Stage 1: Builder
FROM rust:1-bookworm as builder
WORKDIR /build
# Copy source
COPY . .
# Build the mem binary (offline sqlx - uses .sqlx/ cache)
ENV SQLX_OFFLINE=true
RUN cargo build --release -p mem-cli && \
strip target/release/mem && \
rm -rf target/release/deps target/release/build target/release/incremental target/release/.fingerprint
# Stage 2: Runtime
FROM debian:bookworm-slim
WORKDIR /app
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
libssl3 \
postgresql-client \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy binary from builder
COPY --from=builder /build/target/release/mem /app/mem
# Expose port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=10s --timeout=5s --start-period=10s --retries=3 \
CMD curl -f http://localhost:8080/health || exit 1
# Run
CMD ["/app/mem"]