- Add incident reporting routes and logic to handle creation, updating, and retrieval of incidents. - Implement visibility rules for users based on roles (reporters, supervisors). - Create tests for incident reporting functionality to ensure correctness and reliability. - Introduce site and area management routes, including validation for area hierarchy. - Establish user management routes with role-based access control for creating and updating users. - Add setup routes for initializing the application with an organization and admin user. - Implement shared enums and schemas for consistent validation and data handling across the application. - Create a test helper for setting up an in-memory database and API client for testing. - Add TypeScript configuration for server-side code with strict type checking and module resolution.
28 lines
727 B
Docker
28 lines
727 B
Docker
# syntax=docker/dockerfile:1
|
|
|
|
# --- Build the web app ---
|
|
FROM node:24-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# --- Runtime: API server + built web app ---
|
|
FROM node:24-alpine
|
|
ENV NODE_ENV=production \
|
|
PORT=3000 \
|
|
DATABASE_URL=pglite:///app/data/pglite
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci --omit=dev && npm cache clean --force
|
|
COPY server ./server
|
|
COPY shared ./shared
|
|
COPY --from=build /app/dist ./dist
|
|
RUN mkdir -p /app/data && chown node:node /app/data
|
|
USER node
|
|
VOLUME /app/data
|
|
EXPOSE 3000
|
|
HEALTHCHECK --interval=30s --timeout=5s CMD wget -qO- http://127.0.0.1:3000/api/health || exit 1
|
|
CMD ["node", "server/index.ts"]
|