- Integrate DownloadRegistry into concurrent download limit and clean up timers on removal/clear - Wrap MetadataSyncService batch deletes in single transaction - Always re-throw checksum errors in RuffleService to prevent verification bypass - Fix system-settings early return skipping second job update when first cron expression is invalid - Increase DatabaseService hot-reload grace period to 30s - Add permission guard to metadata sync status endpoint - Use encodeURIComponent for game launch content URLs - Clamp limit params to minimum of 1 in jobs routes - Use non-null assertion for authenticated user permissions - Fix ConfirmDialog not calling onCancel on overlay dismiss - Guard FormattedDate against invalid date strings - Add breadcrumbContext to GameListItem memo comparison - Fix MetadataUpdateCard stale closure in interval callback - Move Dockerfile healthcheck to docker-compose for flexibility - Fix build:analyze script to set VITE_ANALYZE env var
73 lines
2.5 KiB
Docker
73 lines
2.5 KiB
Docker
# Production Dockerfile for Flashpoint Web Frontend
|
|
|
|
# =============================================================================
|
|
# Stage 1: Builder - Build for production
|
|
# =============================================================================
|
|
FROM node:20.18.2-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy workspace root package files
|
|
COPY package.json package-lock.json ./
|
|
|
|
# Copy frontend package files
|
|
COPY frontend/package.json ./frontend/
|
|
|
|
# Install dependencies for frontend workspace
|
|
# Use npm ci with frozen lockfile for faster, reproducible builds
|
|
RUN npm ci --workspace=frontend --include-workspace-root --prefer-offline --no-audit
|
|
|
|
# Copy frontend source code
|
|
COPY frontend ./frontend/
|
|
|
|
# Build application (run from frontend directory)
|
|
WORKDIR /app/frontend
|
|
RUN npm run build
|
|
|
|
# =============================================================================
|
|
# Stage 2: Production - Nginx serving static files
|
|
# =============================================================================
|
|
FROM nginx:1.27-alpine
|
|
|
|
# Metadata labels
|
|
LABEL org.opencontainers.image.title="Flashpoint Web Frontend"
|
|
LABEL org.opencontainers.image.description="React web UI for Flashpoint Archive"
|
|
LABEL org.opencontainers.image.version="1.0.0"
|
|
LABEL org.opencontainers.image.source="https://github.com/darkraise/flashpoint-web"
|
|
|
|
# Install runtime dependencies
|
|
# - gettext: provides envsubst for nginx config templating
|
|
RUN apk add --no-cache gettext
|
|
|
|
# Copy built files from builder
|
|
COPY --from=builder /app/frontend/dist /usr/share/nginx/html
|
|
|
|
# Copy nginx configuration from .nginx/ folder
|
|
# Main config: logs to stdout/stderr, uses /tmp for temp files (no permission issues)
|
|
COPY frontend/.nginx/nginx.conf /etc/nginx/nginx.conf
|
|
COPY frontend/.nginx/default.conf.template /etc/nginx/templates/default.conf.template
|
|
|
|
# Copy entrypoint script
|
|
COPY frontend/docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
# Default backend host (can be overridden at runtime)
|
|
ENV BACKEND_HOST=backend \
|
|
BACKEND_PORT=3100
|
|
|
|
# Set up permissions for nginx user (already exists in nginx:alpine)
|
|
RUN chown -R nginx:nginx /usr/share/nginx/html && \
|
|
chown -R nginx:nginx /etc/nginx/conf.d && \
|
|
chmod +x /docker-entrypoint.sh
|
|
|
|
# Expose port (8080 for non-root user)
|
|
EXPOSE 8080
|
|
|
|
# Health check is configured in docker-compose.yml for flexibility.
|
|
# When running standalone (docker run), add --health-cmd manually.
|
|
|
|
# Run as non-root user (nginx user from base image)
|
|
USER nginx
|
|
|
|
# Production command using entrypoint script
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|