feat: v0.2.0 — Docker deployment behind shared Traefik proxy (flight.dev.kkhost.pl)

This commit is contained in:
2026-09-16 18:32:22 +00:00
parent 30e33a08cf
commit eef3430ad5
5 changed files with 53 additions and 1 deletions
+11
View File
@@ -0,0 +1,11 @@
node_modules
.next
data/*.db
test-results
*.tsbuildinfo
.git
.env
.codenomad
# e2e harness: @playwright/test is a host-global install, not a project dependency
e2e
playwright.config.ts
+6
View File
@@ -1,5 +1,11 @@
# Changelog # Changelog
## v0.2.0 — 2026-09-16 18:32
- Docker deployment: multi-stage `Dockerfile` (node:22-alpine; deps → build → runtime) running `next start` on port 3000; no `output: 'standalone'` — the runtime stage keeps full `node_modules` because `/api/mlworker/[file]` reads maplibre-gl dist files from disk at runtime (and `/api/airports` reads `data/*.csv`)
- `.dockerignore`: node_modules, .next, data/*.db, test-results, *.tsbuildinfo, plus .git/.env/.codenomad and the e2e harness (`@playwright/test` is a host-global install, not a project dependency — Next's build-time type check would fail on it inside the image)
- `docker-compose.yml`: single service `flight`, no published ports, joins external network `dev_net` with Traefik labels routing `Host(flight.dev.kkhost.pl)` → port 3000 (plain HTTP entrypoint `web`; TLS terminated upstream)
- Verified: container builds and runs; router registered in dev_traefik rawdata; `curl -H "Host: flight.dev.kkhost.pl" http://localhost/` → 200, `/api/airports` → 200 GeoJSON (7445 features), mlworker .mjs files served from node_modules inside the container; unit suite 12/12 and e2e suite 2/2 still green
## v0.1.0 — 2026-09-16 18:24 ## v0.1.0 — 2026-09-16 18:24
- Scaffolded Next.js (App Router) + TypeScript project; dev server on port 3000 (`npm run dev`) - Scaffolded Next.js (App Router) + TypeScript project; dev server on port 3000 (`npm run dev`)
- Full-viewport MapLibre GL map with OpenFreeMap "liberty" vector basemap (attribution included via style) - Full-viewport MapLibre GL map with OpenFreeMap "liberty" vector basemap (attribution included via style)
+21
View File
@@ -0,0 +1,21 @@
FROM node:22-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
FROM node:22-alpine AS build
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
# No `output: 'standalone'`: the runtime stage keeps the full node_modules because
# /api/mlworker/[file] reads maplibre-gl dist files from disk at runtime, and
# /api/airports reads data/*.csv — both resolved relative to process.cwd().
FROM node:22-alpine AS runtime
WORKDIR /app
ENV NODE_ENV=production NEXT_TELEMETRY_DISABLED=1
COPY --from=build /app ./
EXPOSE 3000
CMD ["npm", "run", "start"]
+14
View File
@@ -0,0 +1,14 @@
services:
flight:
build: .
networks:
- dev_net
labels:
- "traefik.enable=true"
- "traefik.http.routers.flight.rule=Host(`flight.dev.kkhost.pl`)"
- "traefik.http.routers.flight.entrypoints=web"
- "traefik.http.services.flight.loadbalancer.server.port=3000"
networks:
dev_net:
external: true
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "flight-ops", "name": "flight-ops",
"version": "0.1.0", "version": "0.2.0",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 3000", "dev": "next dev -p 3000",