myfari/Dockerfile
2025-03-17 17:48:25 +08:00

30 lines
524 B
Docker

# Use official Node.js LTS image
FROM node:18-alpine
# Set working directory
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy application files
COPY public/images ./public/images
COPY . .
# Expose the application port
EXPOSE 3000
# Set environment variables
ENV NODE_ENV=production
# Health check endpoint
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s \
CMD curl -f http://localhost:3000/ || exit 1
# Run the application
CMD ["node", "server.js"]