fix: add missing build steps and update Node in Dockerfile
- Update base image from node:18-slim to node:22-slim (matching package.json engines requirement) - Add git to apt-get install (needed by npm dependencies) - Add webpack-ext step (builds external bundles) - Add mkdir -p src/pack (prevents race condition) - Add pack-prod step (builds application bundles) - Reorder: build steps before gs-app-server install Tested on ARM64 (Raspberry Pi 4, Docker 29.4.0) and x86_64 (Ubuntu 24.04, Docker 28.0.4). Without these changes, the container starts but serves an incomplete app that never finishes loading.
This commit is contained in:
parent
6ba7507938
commit
c572f2b096
1 changed files with 5 additions and 2 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
FROM node:18-slim
|
FROM node:22-slim
|
||||||
WORKDIR /grid
|
WORKDIR /grid
|
||||||
COPY package.json /grid
|
COPY package.json /grid
|
||||||
COPY app.js /grid
|
COPY app.js /grid
|
||||||
|
|
@ -6,9 +6,12 @@ COPY apps /grid/apps
|
||||||
COPY src /grid/src
|
COPY src /grid/src
|
||||||
COPY web /grid/web
|
COPY web /grid/web
|
||||||
COPY bin /grid/bin
|
COPY bin /grid/bin
|
||||||
RUN apt-get -y update; apt-get -y install curl
|
RUN apt-get -y update; apt-get -y install curl git
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
RUN npm i
|
RUN npm i
|
||||||
|
RUN npm run webpack-ext
|
||||||
|
RUN mkdir -p src/pack
|
||||||
|
RUN npm run pack-prod
|
||||||
RUN npm install -g @gridspace/app-server
|
RUN npm install -g @gridspace/app-server
|
||||||
RUN rm -rf /grid/bin
|
RUN rm -rf /grid/bin
|
||||||
CMD gs-app-server
|
CMD gs-app-server
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue