Establishes multi-tenant database layer with vector similarity search for AI-powered memory features. Includes Docker infrastructure, Prisma ORM integration, NestJS services, and shared types across the monorepo. Key changes: - Docker: PostgreSQL 17 + pgvector v0.7.4, Valkey cache - Schema: 8 models (User, Workspace, Task, Event, Project, ActivityLog, MemoryEmbedding) with RLS preparation - NestJS: PrismaModule, DatabaseModule, EmbeddingsService - Shared: Type-safe enums, constants, and database types Fixes #2 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
26 lines
727 B
Docker
26 lines
727 B
Docker
FROM postgres:17-alpine
|
|
|
|
LABEL maintainer="Mosaic Stack <dev@mosaic.local>"
|
|
LABEL description="PostgreSQL 17 with pgvector extension"
|
|
|
|
# Install build dependencies for pgvector
|
|
RUN apk add --no-cache --virtual .build-deps \
|
|
git \
|
|
build-base
|
|
|
|
# Clone and build pgvector v0.7.4 (without LLVM bitcode compilation)
|
|
RUN git clone --branch v0.7.4 https://github.com/pgvector/pgvector.git /tmp/pgvector \
|
|
&& cd /tmp/pgvector \
|
|
&& make OPTFLAGS="" with_llvm=no \
|
|
&& make install with_llvm=no \
|
|
&& rm -rf /tmp/pgvector
|
|
|
|
# Clean up build dependencies to reduce image size
|
|
RUN apk del .build-deps
|
|
|
|
# Copy initialization scripts
|
|
COPY init-scripts/ /docker-entrypoint-initdb.d/
|
|
|
|
# Expose PostgreSQL port
|
|
EXPOSE 5432
|