node.Dockerfile 453 B

12345678910111213141516171819202122232425262728
  1. # Use Node.js base image for build stage
  2. FROM node:20.12.2 AS build
  3. # Set working directory
  4. WORKDIR /app
  5. # Copy package.json and yarn.lock files
  6. COPY package.json ./
  7. # Install dependencies using Yarn
  8. RUN npm i
  9. # Copy the rest of the application code
  10. COPY . .
  11. ENV SKIP_KEYSTATIC=true
  12. # Build the application
  13. RUN npm run build
  14. # Expose port 80
  15. EXPOSE 4321
  16. ENV HOST=0.0.0.0
  17. ENV PORT=4321
  18. # Start Nginx server
  19. CMD ["node", "dist/server/entry.mjs"]