File size: 1,233 Bytes
69c4be2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
# ============================================================
# HangOut Main Backend — Single File Edition
# Hugging Face Docker Space (mobile-deploy friendly)
# ============================================================
# Bas 3 files chahiye: server.js, package.json, Dockerfile
# Koi src/ folder nahi, koi nested structure nahi.
# ============================================================

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 (no src/ folder)
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 — service responds with 200 on /health
HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \
    CMD curl -f http://localhost:7860/health || exit 1

# Non-root user for security
USER node

# Start the service (single file!)
CMD ["node", "server.js"]