cmms/frontend/Dockerfile

37 lines
778 B
Docker

# Atlas CMMS Frontend Dockerfile
# Build stage
FROM node:18-alpine AS build
WORKDIR /app
# Copy package files
COPY package*.json ./
# Install dependencies
RUN npm ci --only=production
# Copy source code
COPY . .
# Build the application
RUN npm run build
# Production stage
FROM nginx:1.25-alpine
# Copy built application from build stage
COPY --from=build /app/dist /usr/share/nginx/html
# Copy nginx configuration optimized for proxy manager
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Expose port 80 (will be proxied by Nginx Proxy Manager)
EXPOSE 80
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost/ || exit 1
# Start nginx
CMD ["nginx", "-g", "daemon off;"]