unreal-chat/apps/web/Dockerfile
Juan Sebastian Montoya 16731409df refactor: migrate from Next.js to SolidJS and GraphQL
- Converted web application from Next.js to SolidJS with Vite
- Replaced React components with SolidJS components
- Implemented GraphQL client using URQL
- Added authentication, room, and chat components
- Updated project structure and configuration files
- Removed unnecessary Next.js and docs-related files
- Added Docker support for web and API applications
2025-03-04 01:08:52 -05:00

44 lines
No EOL
918 B
Docker

FROM node:22-alpine AS base
# Install dependencies only when needed
FROM base AS deps
WORKDIR /app
# Copy package files
COPY package.json package-lock.json* ./
COPY apps/web/package.json ./apps/web/package.json
# Install dependencies
RUN npm ci
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Build the project
ARG NODE_ENV
ARG VITE_API_URL
ARG VITE_WS_URL
RUN npm run web:build
# Production image, copy all the files and run the server
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
# Copy necessary files
COPY --from=builder /app/apps/web/dist ./dist
COPY --from=builder /app/apps/web/package.json ./package.json
COPY --from=builder /app/node_modules ./node_modules
# Install serve to run the application
RUN npm install -g serve
# Expose the port
EXPOSE 5173
# Start the server
CMD serve -s dist -l 5173