- Add security headers (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection) - Implement proper cache control for static assets and prevent index.html caching - Fix SSE handling to properly fetch new compression jobs - Immediately refresh job list after queuing compression for better UX feedback
32 lines
543 B
Docker
32 lines
543 B
Docker
# Build stage
|
|
FROM node:20-alpine as builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy package files
|
|
COPY package.json package-lock.json* ./
|
|
|
|
# Install dependencies
|
|
RUN npm install
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the application
|
|
RUN npm run build
|
|
|
|
# Production stage
|
|
FROM nginx:alpine
|
|
|
|
# Copy built assets from builder stage
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
|
|
|
# Copy nginx configurations
|
|
COPY nginx-main.conf /etc/nginx/nginx.conf
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Expose port
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|