36 lines
679 B
Docker
36 lines
679 B
Docker
|
|
FROM node:20-alpine AS builder
|
||
|
|
|
||
|
|
# Set working directory
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
# Copy package files
|
||
|
|
COPY Nitro-Cool-UI/package*.json ./
|
||
|
|
|
||
|
|
# Install dependencies
|
||
|
|
RUN npm ci
|
||
|
|
|
||
|
|
# Copy source code
|
||
|
|
COPY Nitro-Cool-UI/ .
|
||
|
|
|
||
|
|
# Build application
|
||
|
|
RUN npm run build
|
||
|
|
|
||
|
|
# Production stage
|
||
|
|
FROM nginx:alpine
|
||
|
|
|
||
|
|
# Copy built files from builder
|
||
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
||
|
|
|
||
|
|
# Copy nginx configuration
|
||
|
|
COPY cool-ui/nginx.conf /etc/nginx/conf.d/default.conf
|
||
|
|
|
||
|
|
# Expose port
|
||
|
|
EXPOSE 80
|
||
|
|
|
||
|
|
# Health check
|
||
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||
|
|
CMD wget --quiet --tries=1 --spider http://localhost/ || exit 1
|
||
|
|
|
||
|
|
# Start nginx
|
||
|
|
CMD ["nginx", "-g", "daemon off;"]
|