CoolFace
Apppublic

flen-crypto/tapp

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes
index.html44 linesDownload Raw Back to root
1# -----------------------------------------------2# Multi-stage Dockerfile for a React + Vite PWA3# -----------------------------------------------4 5# 1) Build stage6FROM node:20-alpine AS build7 8WORKDIR /app9 10# Install global pnpm for faster installs11RUN corepack enable && corepack prepare pnpm@latest --activate12 13# Copy dependency manifests first for better layer caching14COPY package.json pnpm-lock.yaml ./15 16# Install all dependencies (including devDependencies for build)17RUN pnpm install --frozen-lockfile18 19# Copy source files20COPY . .21 22# Build the production bundle23RUN pnpm run build24 25# -----------------------------------------------26# 2) Runtime stage – tiny nginx image27# -----------------------------------------------28FROM nginx:1.25-alpine29 30# Copy built static assets from build stage31COPY --from=build /app/dist /usr/share/nginx/html32 33# Copy custom nginx config to serve SPA & PWA headers34COPY nginx.conf /etc/nginx/conf.d/default.conf35 36# Allow nginx to bind to privileged ports as non-root37RUN touch /var/run/nginx.pid && \38    chown -R nginx:nginx /var/run/nginx.pid /usr/share/nginx/html /var/cache/nginx39 40USER nginx41 42EXPOSE 8043 44CMD ["nginx", "-g", "daemon off;"]