chore: update comments and documentation for clarity and consistency across various files
- Translated comments from Spanish to English in vite.config.ts, docker-compose.yml, attendance-risk.ts, analytics.ts, attendance.ts, attendees.ts, enums.ts, groups.ts, and onboarding.ts. - Improved descriptions for better understanding of code functionality and purpose. - Ensured uniformity in terminology and phrasing throughout the codebase.
This commit is contained in:
@@ -5,21 +5,21 @@ FROM oven/bun:1.4-alpine AS base
|
||||
WORKDIR /app
|
||||
ENV CI=1
|
||||
|
||||
# ─── Dependencias ────────────────────────────────────────────────────────────
|
||||
# Solo los package.json:bun no necesita el código fuente para resolver el lockfile.
|
||||
# ─── Dependencies ────────────────────────────────────────────────────────────
|
||||
# Only the package.json files: bun needs no source code to resolve the lockfile.
|
||||
FROM base AS deps
|
||||
COPY package.json bun.lock bunfig.toml turbo.json ./
|
||||
COPY apps/backend/package.json ./apps/backend/
|
||||
COPY apps/web/package.json ./apps/web/
|
||||
COPY packages/config/package.json ./packages/config/
|
||||
COPY packages/shared/package.json ./packages/shared/
|
||||
# El cache global de bun pesa ~370MB: se borra en la misma capa.
|
||||
# bun's global cache weighs ~370MB: it is dropped in the same layer.
|
||||
RUN bun install --frozen-lockfile && rm -rf /root/.bun/install
|
||||
|
||||
# ─── Prisma Client ───────────────────────────────────────────────────────────
|
||||
# El generator "prisma-client" emite TypeScript, así que el cliente generado se
|
||||
# ejecuta con Bun sin compilar nada. La URL es un placeholder: `generate` no
|
||||
# necesita conexión, solo leer el schema.
|
||||
# The "prisma-client" generator emits TypeScript, so the generated client runs
|
||||
# with Bun without compilation. The URL is a placeholder: `generate` only needs
|
||||
# to read the schema, not connect to a database.
|
||||
FROM deps AS generate
|
||||
ARG DATABASE_URL=postgresql://user:password@localhost:5432/placeholder
|
||||
ENV DATABASE_URL=$DATABASE_URL
|
||||
@@ -28,7 +28,7 @@ COPY apps/backend/prisma ./apps/backend/prisma
|
||||
WORKDIR /app/apps/backend
|
||||
RUN bun run db:generate
|
||||
|
||||
# ─── Imagen de la API ────────────────────────────────────────────────────────
|
||||
# ─── API image ───────────────────────────────────────────────────────────────
|
||||
FROM base AS api
|
||||
ENV NODE_ENV=production \
|
||||
PORT=4000
|
||||
@@ -37,30 +37,30 @@ COPY package.json bun.lock bunfig.toml ./
|
||||
COPY apps/backend/package.json ./apps/backend/
|
||||
COPY packages/config/package.json ./packages/config/
|
||||
COPY packages/shared/package.json ./packages/shared/
|
||||
# `prisma` y `dotenv` son dependencies (no dev) porque el entrypoint corre
|
||||
# `prisma migrate deploy` en cada arranque. Con `--production` no entra el resto
|
||||
# del tooling: biome, typescript, turbo.
|
||||
# `prisma` and `dotenv` are dependencies (not dev) because the entrypoint runs
|
||||
# `prisma migrate deploy` on every boot. With `--production` the rest of the
|
||||
# tooling does not come in: biome, typescript, turbo.
|
||||
RUN bun install --frozen-lockfile --production && rm -rf /root/.bun/install
|
||||
|
||||
# El CLI de Prisma carga prisma.config.ts, que apunta al schema.
|
||||
# The Prisma CLI loads prisma.config.ts, which points to the schema.
|
||||
COPY apps/backend/prisma ./apps/backend/prisma
|
||||
COPY apps/backend/prisma.config.ts ./apps/backend/prisma.config.ts
|
||||
COPY --from=generate /app/apps/backend/generated ./apps/backend/generated
|
||||
COPY apps/backend/tsconfig.json ./apps/backend/
|
||||
COPY apps/backend/src ./apps/backend/src
|
||||
# @gruperly/shared se consume como fuente TS; @gruperly/config aporta el
|
||||
# tsconfig base del que extiende el tsconfig del backend.
|
||||
# @gruperly/shared is consumed as TS source; @gruperly/config provides the base
|
||||
# tsconfig that the backend tsconfig extends.
|
||||
COPY packages ./packages
|
||||
COPY apps/backend/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
WORKDIR /app/apps/backend
|
||||
EXPOSE 4000
|
||||
# Sin `${...}`: el CMD corre bajo /bin/sh (ash), donde eso es un error de sintaxis.
|
||||
# No `${...}` here: the CMD runs under /bin/sh (ash), where that is a syntax error.
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
||||
CMD bun --eval "fetch('http://127.0.0.1:4000/api/v1/health').then((r) => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"]
|
||||
# Bun ejecuta el TypeScript directamente y resuelve `@/*` con el tsconfig.json,
|
||||
# igual que `bun start` en local.
|
||||
# Bun runs the TypeScript directly and resolves `@/*` with the tsconfig.json,
|
||||
# same as `bun start` locally.
|
||||
CMD ["bun", "src/server.ts"]
|
||||
|
||||
Reference in New Issue
Block a user