Update Dockerfile
Browse files12345678910111213141516171819FROM node:20-slimWORKDIR /code# Copy package filesCOPY package*.json ./# Install dependencies (adding dotenv)RUN npm install# Bundle app sourceCOPY . .# Default environment variables if not provided at runtimeENV PORT=7000ENV NODE_ENV=production# Start the applicationCMD ["node", "index.js"]1234567891011121314151617181920212223# Use the official Node.js 18 base imagFROM node:18-slim# Set the working directory inside the containerWORKDIR /usr/src/app# Copy the package.json and package-lock.json if availableCOPY package*.json ./# Install the app dependenciesRUN npm install --production# Copy the rest of the application code to the containerCOPY . .# Set environment variable to productionENV NODE_ENV=production# Expose the port Hugging Face Spaces will bind toEXPOSE 7000# Command to start the appCMD ["node", "index.js"]
Dockerfile+13-9