IncidentMgmtSystem / Dockerfile
Debashis
Fix deployment files
c9af408
raw
history blame contribute delete
946 Bytes
# Frontend-only deployment for Hugging Face Spaces
# This is the recommended approach for quick deployment
FROM node:18-alpine AS builder
WORKDIR /app
# Copy frontend files
COPY frontend/package*.json ./
# Install dependencies
RUN npm install --prefer-offline --no-audit
# Copy source code
COPY frontend/src ./src
COPY frontend/index.html .
COPY frontend/vite.config.ts .
COPY frontend/tsconfig.json .
COPY frontend/tsconfig.node.json .
# Build for production
RUN npm run build
# Runtime stage
FROM node:18-alpine
WORKDIR /app
# Install serve for production
RUN npm install -g serve
# Copy built application
COPY --from=builder /app/dist ./dist
# Expose port (Hugging Face spaces use port 7860)
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD wget --quiet --tries=1 --spider http://localhost:7860 || exit 1
# Start the application
CMD ["serve", "-s", "dist", "-l", "7860"]