forked from FalkorDB/QueryWeaver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
74 lines (54 loc) · 2.16 KB
/
Dockerfile
File metadata and controls
74 lines (54 loc) · 2.16 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
# 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 \
&& 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 pipenv
RUN python3 -m pip install --no-cache-dir --break-system-packages pipenv
# Copy Pipfile and Pipfile.lock
COPY Pipfile Pipfile.lock ./
# Install Python dependencies from Pipfile
RUN PIP_BREAK_SYSTEM_PACKAGES=1 pipenv sync --system
# 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.
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get update && apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# 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 . .
# 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"]