-
Notifications
You must be signed in to change notification settings - Fork 102
Expand file tree
/
Copy pathDockerfile
More file actions
92 lines (69 loc) · 2.76 KB
/
Dockerfile
File metadata and controls
92 lines (69 loc) · 2.76 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
# Multi-stage build: Start with Python 3.12 base
FROM python:3.12-bookworm AS python-base
# Main stage: Use FalkorDB base and copy Python 3.12
FROM falkordb/falkordb:latest
ENV PYTHONUNBUFFERED=1 \
FALKORDB_HOST=localhost \
FALKORDB_PORT=6379
USER root
# Copy Python 3.12 from the python base image
COPY --from=python-base /usr/local /usr/local
# Install netcat for wait loop in start.sh and system build tools needed for
# compiling Python wheels (g++, make, libc-dev)
RUN apt-get update && apt-get install -y --no-install-recommends \
netcat-openbsd \
git \
build-essential \
curl \
ca-certificates \
gnupg \
&& rm -rf /var/lib/apt/lists/* \
&& ln -sf /usr/local/bin/python3.12 /usr/bin/python3 \
&& ln -sf /usr/local/bin/python3.12 /usr/bin/python
WORKDIR /app
# Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
# Copy pyproject.toml, uv.lock, and README.md (needed by hatchling during install)
COPY pyproject.toml uv.lock* README.md ./
# Install packages into system Python (no virtualenv in container)
ENV UV_SYSTEM_PYTHON=1
# Ensure venv binaries are on PATH (uv sync always creates .venv)
ENV PATH="/app/.venv/bin:$PATH"
# Install Python dependencies only (project itself installed after COPY)
RUN uv sync --frozen --no-dev --no-install-project
# Install Node.js (Node 22) so we can build the frontend inside the image.
# Use NodeSource setup script to get a recent Node version on Debian-based images.
# Remove any pre-installed nodejs first to avoid conflicts.
RUN apt-get update \
&& apt-get remove -y nodejs || true \
&& rm -rf /var/lib/apt/lists/* \
&& curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get update \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/* \
&& node --version && npm --version
# Copy only frontend package files so Docker can cache npm installs when
# package.json / package-lock.json don't change.
COPY app/package*.json ./app/
# Install frontend dependencies (reproducible install using package-lock)
RUN if [ -f ./app/package-lock.json ]; then \
npm --prefix ./app ci --no-audit --no-fund; \
elif [ -f ./app/package.json ]; then \
npm --prefix ./app install --no-audit --no-fund; \
else \
echo "No frontend package.json found, skipping npm install"; \
fi
COPY ./app ./app
RUN npm --prefix ./app run build
# Copy application code
COPY . .
# Install the project package now that source code is available
RUN uv sync --frozen --no-dev
# Copy and make start.sh executable
COPY start.sh /start.sh
RUN chmod +x /start.sh
# Add MCP label
LABEL io.modelcontextprotocol.server.name="com.falkordb/QueryWeaver"
EXPOSE 5000 6379 3000
# Use start.sh as entrypoint
ENTRYPOINT ["/start.sh"]