18 lines
739 B
Text
18 lines
739 B
Text
|
|
# syntax=docker/dockerfile:1
|
||
|
|
|
||
|
|
# ---- build: type-check and bundle the PWA (the places snapshot and timetable in public/data are part of the repo) ----
|
||
|
|
FROM node:24-slim AS build
|
||
|
|
WORKDIR /app
|
||
|
|
RUN npm install -g pnpm@11.22.0
|
||
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||
|
|
RUN --mount=type=cache,target=/root/.local/share/pnpm/store pnpm install --frozen-lockfile
|
||
|
|
COPY . .
|
||
|
|
RUN pnpm build
|
||
|
|
|
||
|
|
# ---- serve: static files + the /rt/ proxy for live transit data (see docker/nginx.conf) ----
|
||
|
|
FROM nginx:1.27-alpine
|
||
|
|
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
|
||
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||
|
|
EXPOSE 80
|
||
|
|
HEALTHCHECK --interval=30s --timeout=3s --retries=3 CMD wget -q -O /dev/null http://127.0.0.1/healthz || exit 1
|