my-webapp-hf / Dockerfile
Deminiko
fix: resolve 404 errors and API routing issues
714fe46
raw
history blame contribute delete
590 Bytes
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Copy package files
COPY public/package*.json ./
# Install dependencies (production only)
RUN npm ci --omit=dev
# Copy application code
COPY public .
# Expose HF Spaces port (7860)
EXPOSE 7860
# Set production environment
ENV NODE_ENV=production
ENV PORT=7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD node -e "require('http').get('http://localhost:7860/health', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"
# Start application
CMD ["npm", "start"]