11# Multi-stage build: Start with Python 3.12 base
22FROM python:3.12-bookworm AS python-base
33
4+ # Use the official Node image so npm is always available during frontend builds
5+ FROM node:22-bookworm AS node-base
6+
47# Main stage: Use FalkorDB base and copy Python 3.12
58FROM falkordb/falkordb:latest
69
@@ -13,30 +16,30 @@ USER root
1316# Copy Python 3.12 from the python base image
1417COPY --from=python-base /usr/local /usr/local
1518
19+ # Copy Node.js tooling from the official Node image
20+ COPY --from=node-base /usr/local/bin/node /usr/local/bin/node
21+ COPY --from=node-base /usr/local/lib/node_modules /usr/local/lib/node_modules
22+
1623# Install netcat for wait loop in start.sh and system build tools
1724RUN apt-get update && apt-get install -y --no-install-recommends \
1825 netcat-openbsd \
1926 git \
2027 build-essential \
21- curl \
2228 ca-certificates \
23- gnupg \
2429 && rm -rf /var/lib/apt/lists/* \
2530 && ln -sf /usr/local/bin/python3.12 /usr/bin/python3 \
26- && ln -sf /usr/local/bin/python3.12 /usr/bin/python
31+ && ln -sf /usr/local/bin/python3.12 /usr/bin/python \
32+ && ln -sf ../lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \
33+ && ln -sf ../lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx
2734
2835WORKDIR /app
2936
3037# Install Python dependencies
3138COPY pyproject.toml ./
3239RUN pip install --no-cache-dir --break-system-packages .
3340
34- # Install Node.js for building the frontend
35- RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
36- && apt-get update \
37- && apt-get install -y nodejs \
38- && rm -rf /var/lib/apt/lists/* \
39- && node --version && npm --version
41+ # Verify Node.js tooling for building the frontend
42+ RUN node --version && npm --version
4043
4144# Copy frontend package files and install dependencies
4245COPY app/package*.json ./app/
@@ -61,4 +64,3 @@ EXPOSE 5000 6379
6164
6265# Use start.sh as entrypoint
6366ENTRYPOINT ["/start.sh" ]
64-
0 commit comments