Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.
# syntax=docker/dockerfile:1
FROM node:24.21.0-alpine AS builder
WORKDIR /app
RUN apk add --no-cache git python3 make g++ bash sed
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
# Build without secrets — tokens are injected at runtime via /config.json or KEPLER_* env
RUN yarn build
FROM node:24.21.0-alpine AS runtime
WORKDIR /app
RUN npm install -g serve@14
COPY --from=builder /app/examples/demo-app/dist ./dist
COPY docker/entrypoint.sh docker/merge-runtime-config.js ./
COPY docker/config.example.json docker/config.full-example.json ./
RUN chmod +x /app/entrypoint.sh
EXPOSE 8080
ENTRYPOINT ["/app/entrypoint.sh"]