File size: 827 Bytes
532ddfa 54420b5 532ddfa a5566ce 532ddfa a5566ce 8f03b91 a5566ce 532ddfa 16bbeb7 532ddfa 8f03b91 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# Dockerfile
FROM node:20-slim
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3 \
git \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy root package files and install
COPY package*.json ./
RUN npm install
# Copy server file
COPY server.js ./
# Copy frontend folder
COPY frontend ./frontend
# Build frontend
WORKDIR /app/frontend
RUN npm install && npm run build
# Back to root
WORKDIR /app
# Expose port 7860 (required by Hugging Face)
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD node -e "require('http').get('http://localhost:7860/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
RUN chmod -R 777 /app
# Start the application
CMD ["npm", "start"] |