Spaces:
Runtime error
Runtime error
File size: 1,114 Bytes
4fe5060 | 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 | # ============================================================
# HangOut Socket.io Service — Single File Edition
# Hugging Face Docker Space (mobile-deploy friendly)
# ============================================================
# Bas 3 files chahiye: server.js, package.json, Dockerfile
# ============================================================
FROM node:20-slim
# Install curl for healthchecks
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy package files first (better layer caching)
COPY package.json package-lock.json* ./
# Install production dependencies only
RUN npm install --only=production --no-audit --no-fund
# Copy the SINGLE server file
COPY server.js ./
# Hugging Face Space uses port 7860 by default
ENV PORT=7860
ENV HOST=0.0.0.0
ENV NODE_ENV=production
EXPOSE 7860
# Healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
# Non-root user for security
USER node
# Start the service
CMD ["node", "server.js"]
|