Skip to content

Commit 68cf518

Browse files
authored
Merge pull request #595 from FalkorDB/copilot/fix-docker-build-error
Stabilize Docker image builds and add PR-time Docker verification
2 parents a1b3a83 + 235f62a commit 68cf518

2 files changed

Lines changed: 28 additions & 10 deletions

File tree

.github/workflows/nextjs.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
workflow_dispatch:
88

9+
permissions:
10+
contents: read
11+
912
concurrency:
1013
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
1114
cancel-in-progress: true
@@ -41,3 +44,16 @@ jobs:
4144

4245
- name: Install backend dependencies
4346
run: pip install -e ".[test]"
47+
48+
docker-build:
49+
runs-on: ubuntu-latest
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
54+
- name: Build Docker image
55+
uses: docker/build-push-action@v7
56+
with:
57+
context: .
58+
file: ./Dockerfile
59+
push: false

Dockerfile

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Multi-stage build: Start with Python 3.12 base
22
FROM 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
58
FROM falkordb/falkordb:latest
69

@@ -13,30 +16,30 @@ USER root
1316
# Copy Python 3.12 from the python base image
1417
COPY --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
1724
RUN 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

2835
WORKDIR /app
2936

3037
# Install Python dependencies
3138
COPY pyproject.toml ./
3239
RUN 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
4245
COPY app/package*.json ./app/
@@ -61,4 +64,3 @@ EXPOSE 5000 6379
6164

6265
# Use start.sh as entrypoint
6366
ENTRYPOINT ["/start.sh"]
64-

0 commit comments

Comments
 (0)