Update Dockerfile
Browse files12345678910111213141516171819FROM node:20-slimWORKDIR /code# Copy package filesCOPY package*.json ./# Install dependencies (adding dotenv)RUN npm install express node-fetch cors dotenv# Bundle app sourceCOPY . .# Default environment variables if not provided at runtimeENV PORT=7860ENV NODE_ENV=production# Start the applicationCMD ["node", "server.js"]12345678910111213141516171819FROM node:20-slimWORKDIR /app# Copy only the bundled application fileCOPY app.js .# Default environment variablesENV PORT=7860ENV NODE_ENV=production# Make the application executableRUN chmod +x app.js# Expose the port that the application usesEXPOSE 7860# Start the application directlyCMD ["./app.js"]
Dockerfile+12-12