mirror of
https://github.com/temetro/temetro.git
synced 2026-07-26 11:58:14 +00:00
9dabe2f5d2
Implements the first temetro backend: an Express 5 API on Postgres via Drizzle ORM, with authentication and multi-tenant clinics powered by Better Auth. - Auth: email/password with required email verification, password reset, rate limiting, CSRF/trusted-origins, secure cookies, session audit hook. - Organizations (clinics) with RBAC (owner/admin/member/viewer) and an extended `patient` permission set; member invitations by email. - Org-scoped patient records mirroring the frontend Patient shape, with CRUD endpoints gated by permission (read/write/delete). - Email helper logs links to the console when SMTP is unset (zero-setup local dev); Dockerfile + docker-compose (db + backend + frontend) with migrations applied on startup and a configurable Postgres host port. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
20 lines
561 B
Docker
20 lines
561 B
Docker
# --- build stage: compile TypeScript -> dist ------------------------------
|
|
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# --- runtime stage: prod deps only -----------------------------------------
|
|
FROM node:22-alpine AS runtime
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production
|
|
COPY package*.json ./
|
|
RUN npm ci --omit=dev
|
|
COPY --from=build /app/dist ./dist
|
|
COPY --from=build /app/drizzle ./drizzle
|
|
EXPOSE 4000
|
|
# Apply migrations, then start the API.
|
|
CMD ["sh", "-c", "node dist/migrate.js && node dist/index.js"]
|