hangout-socket / Dockerfile
iosrvk0's picture
Upload 3 files
4fe5060 verified
Raw
History Blame Contribute Delete
1.11 kB
# ============================================================
# 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"]