mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
597f679901
- Add docker-init.sh script to initialize config.json pointing to /app/data - Update Dockerfile to use initialization script as entrypoint - Update docker-compose.yml comments to reflect automatic configuration - Ensures mounted knowledge files in /app/data are properly indexed Fixes issue where .basic-memory/config.json wasn't configured to use the mounted directory, causing files in /app/data to not get indexed. Co-authored-by: Paul Hernandez <phernandez@users.noreply.github.com>
37 lines
993 B
Docker
37 lines
993 B
Docker
FROM python:3.12-slim-bookworm
|
|
|
|
# Copy uv from official image
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
|
|
# Copy the project into the image
|
|
ADD . /app
|
|
|
|
# Sync the project into a new environment, asserting the lockfile is up to date
|
|
WORKDIR /app
|
|
RUN uv sync --locked
|
|
|
|
# Create data directory
|
|
RUN mkdir -p /app/data
|
|
|
|
# Copy and setup initialization script
|
|
COPY docker-init.sh /app/docker-init.sh
|
|
RUN chmod +x /app/docker-init.sh
|
|
|
|
# Set default data directory and add venv to PATH
|
|
ENV BASIC_MEMORY_HOME=/app/data \
|
|
PATH="/app/.venv/bin:$PATH"
|
|
|
|
# Expose port
|
|
EXPOSE 8000
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
|
CMD basic-memory --version || exit 1
|
|
|
|
# Use initialization script as entrypoint with the basic-memory command
|
|
ENTRYPOINT ["/app/docker-init.sh"]
|
|
CMD ["basic-memory", "mcp", "--transport", "sse", "--host", "0.0.0.0", "--port", "8000"] |