nxtgauge-frontend-solid/Dockerfile
Tracewebstudio Dev 2d7117a47a fix(ci): use internal registry for node:20-alpine base image
- Change FROM node:20-alpine to FROM registry.nxtgauge.com/node:20-alpine
- Update both Dockerfile and Dockerfile.simple
- Fixes Docker Hub rate limiting errors in Woodpecker builds

Images to mirror:
- docker pull node:20-alpine
- docker tag node:20-alpine registry.nxtgauge.com/node:20-alpine
- docker push registry.nxtgauge.com/node:20-alpine
2026-04-16 19:30:25 +02:00

42 lines
1.1 KiB
Docker

# Multi-stage build with memory optimization
FROM node:20-slim AS builder
WORKDIR /app
# Skip browser downloads
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
ENV CYPRESS_INSTALL_BINARY=0
ENV NODE_ENV=production
# Set API URLs for build (create .env file)
RUN echo "VITE_API_URL=http://localhost:9100" > .env && \
echo "PUBLIC_API_URL=http://localhost:9100/api" >> .env && \
echo "VITE_RUST_API_URL=http://localhost:9100/api" >> .env
# Install build dependencies
RUN apt-get update && apt-get install -y python3 make g++ git && rm -rf /var/lib/apt/lists/*
# Copy package files
COPY package*.json ./
# Install dependencies including devDependencies (needed for Tailwind/Vite)
RUN npm ci --legacy-peer-deps --prefer-offline --no-audit --include=dev
# Copy source
COPY . .
# Build with memory optimization
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN npm run build
# Runtime stage
FROM registry.nxtgauge.com/node:20-alpine
WORKDIR /app
# Copy built output
COPY --from=builder /app/.output ./.output
ENV PORT=9201
ENV HOST=0.0.0.0
EXPOSE 9201
CMD ["node", ".output/server/index.mjs"]