Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

1.3 KB
Raw Blame
# syntax=docker/dockerfile:1
FROM node:24.21.0-alpine

WORKDIR /app

RUN apk add --no-cache git python3 make g++ bash sed

# Provide a no-op xdg-open so the dev server doesn't crash trying to open a browser
RUN printf '#!/bin/sh\nexit 0\n' > /usr/local/bin/xdg-open && chmod +x /usr/local/bin/xdg-open

RUN corepack enable && corepack prepare [email protected] --activate

# Copy dependency manifests first for better layer caching
COPY package.json yarn.lock .yarnrc.yml ./
COPY --parents src/*/package.json ./
COPY --parents examples/demo-app/package.json examples/demo-app/yarn.lock examples/demo-app/.yarnrc.yml ./

# Skip all postinstall scripts to avoid building the gl native package (GPU headers not available)
RUN --mount=type=cache,id=kepler-yarn,target=/yarn-cache \
    yarn config set enableScripts false && \
    YARN_CACHE_FOLDER=/yarn-cache yarn install && \
    yarn config set enableScripts true

# Selectively run esbuild postinstall (needed for the correct platform binary)
RUN cd node_modules/esbuild && node install.js

# Now copy the full source
COPY . .

RUN yarn fix-dependencies
RUN yarn workspaces foreach -At run stab

WORKDIR /app/examples/demo-app

RUN --mount=type=cache,id=kepler-yarn,target=/yarn-cache \
    YARN_CACHE_FOLDER=/yarn-cache yarn install

EXPOSE 8080

CMD ["yarn", "start:local"]