LogicGoInfotechSpaces's picture
Create dockerfile
20602cf verified
raw
history blame
757 Bytes
# -------------------------------------------------------------
# Base Image
# -------------------------------------------------------------
FROM node:18-slim AS build
WORKDIR /app
# Copy package files first (cache-friendly)
COPY package.json package-lock.json* ./
# Install dependencies
RUN npm install --production
# Copy source code
COPY . .
# -------------------------------------------------------------
# Final Image Stage
# -------------------------------------------------------------
FROM node:18-slim
ENV NODE_ENV=production
ENV PORT=7860
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Copy only installed node_modules + code
COPY --from=build /app /app
# HuggingFace Spaces requires port 7860
EXPOSE 7860
# Start server
CMD ["node", "index.js"]