k8sConfigs/myrari/Dockerfile
2025-03-24 19:12:41 +08:00

29 lines
489 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 . .
# 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"]