Files
gruperly/Dockerfile.web
Jose Selesan 69275c37b4 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.
2026-10-01 16:06:54 -03:00

36 lines
1.9 KiB
Docker

# syntax=docker/dockerfile:1
# ─── Base ────────────────────────────────────────────────────────────────────
FROM oven/bun:1.4-alpine AS base
WORKDIR /app
ENV CI=1
# ─── Dependencies ────────────────────────────────────────────────────────────
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/
# bun's global cache weighs ~370MB: it is dropped in the same layer.
RUN bun install --frozen-lockfile && rm -rf /root/.bun/install
# ─── Vite build ──────────────────────────────────────────────────────────────
FROM deps AS build
# Vite replaces import.meta.env.* at build time, not at runtime.
# Empty = same origin: nginx's /api proxy acts as the API.
ARG VITE_API_URL=""
ENV VITE_API_URL=$VITE_API_URL
COPY apps/web ./apps/web
COPY packages ./packages
RUN bun --filter @gruperly/web build
# ─── Final image ─────────────────────────────────────────────────────────────
FROM nginx:1.27-alpine AS web
COPY apps/web/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/apps/web/dist /usr/share/nginx/html
EXPOSE 80
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD wget --quiet --tries=1 --spider http://127.0.0.1/ || exit 1
CMD ["nginx", "-g", "daemon off;"]