@@ -8,8 +8,13 @@ ARG GID=1000
88COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
99
1010# Set environment variables
11+ # UV_PYTHON_INSTALL_DIR ensures Python is installed to a persistent location
12+ # that survives in the final image (not in /root/.local which gets lost)
13+ # UV_PYTHON_PREFERENCE=only-managed tells uv to use its managed Python version
1114ENV PYTHONUNBUFFERED=1 \
12- PYTHONDONTWRITEBYTECODE=1
15+ PYTHONDONTWRITEBYTECODE=1 \
16+ UV_PYTHON_INSTALL_DIR=/python \
17+ UV_PYTHON_PREFERENCE=only-managed
1318
1419# Create a group and user with the provided UID/GID
1520# Check if the GID already exists, if not create appgroup
@@ -19,9 +24,10 @@ RUN (getent group ${GID} || groupadd --gid ${GID} appgroup) && \
1924# Copy the project into the image
2025ADD . /app
2126
22- # Sync the project into a new environment, asserting the lockfile is up to date
27+ # Install Python 3.13 explicitly and sync the project
2328WORKDIR /app
24- RUN uv sync --locked
29+ RUN uv python install 3.13
30+ RUN uv sync --locked --python 3.13
2531
2632# Create necessary directories and set ownership
2733RUN mkdir -p /app/data/basic-memory /app/.basic-memory && \
@@ -43,4 +49,4 @@ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
4349 CMD basic-memory --version || exit 1
4450
4551# Use the basic-memory entrypoint to run the MCP server with default SSE transport
46- CMD ["basic-memory" , "mcp" , "--transport" , "sse" , "--host" , "0.0.0.0" , "--port" , "8000" ]
52+ CMD ["basic-memory" , "mcp" , "--transport" , "sse" , "--host" , "0.0.0.0" , "--port" , "8000" ]
0 commit comments