Files
gods-eye-view/Dockerfile
T
SM-26andClaude Opus 5 2e50836b08 feat: add a Docker install path
Vite's dev server is the whole app here — it serves the client and runs every
API proxy as middleware — so one container running `npm run dev` covers it, and
HOST/PORT are already env-driven.

Three details are deliberate:

- The port publishes to 127.0.0.1. Docker's usual "4173:4173" binds every host
  interface, which would silently make the README's LAN warning the default for
  a server that brokers configured provider keys.
- The repo is bind-mounted, so keys saved from Provider Settings, .gev-cache
  and .gev-logs persist on the host exactly as they do under `npm run dev`.
  node_modules stays in the image so a host install cannot shadow the
  Linux-built native deps.
- The container runs as the host user, since everything it writes lands in
  that bind mount. Vite's dep optimizer still needs to write inside the image's
  node_modules, hence the two loosened directories.

Puppeteer's Chromium download is skipped: it is only needed by `npm run
test:track`, which the README points at the host.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-10-10 19:48:02 +02:00

29 lines
1.1 KiB
Docker

# syntax=docker/dockerfile:1
#
# The dev server is the whole app: Vite serves the client AND runs the API
# proxies (ADS-B, AIS, Overpass, OpenAI Realtime, ...) as middleware, so there
# is nothing else to containerise. See compose.yaml for the usual entry point.
FROM node:24-slim
# Puppeteer is only used by the QA scripts; skip its ~150MB Chromium download.
ENV PUPPETEER_SKIP_DOWNLOAD=1
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# compose runs the container as the host user so bind-mounted files stay
# yours, but node_modules is baked in as root. Vite only needs to write its
# dep-optimizer cache, so open up those two directories rather than chowning
# a few hundred MB to a UID we cannot know at build time.
RUN mkdir -p node_modules/.vite && chmod 777 node_modules node_modules/.vite
COPY . .
# Bind to all interfaces, otherwise the published port hits nothing. Vite also
# relaxes allowedHosts when HOST is 0.0.0.0, which is what lets the browser
# reach it as "localhost".
ENV HOST=0.0.0.0
ENV PORT=4173
EXPOSE 4173
CMD ["npm", "run", "dev"]