spawner/frontend/Dockerfile
XPS\Micro 67149e1544 fix: install curl in frontend Dockerfile for healthcheck compatibility
- Added curl installation in Debian slim runner stage
- curl is required for healthcheck in docker-compose.yml
- curl is pre-installed in node:20-slim base image was incorrect assumption
- Healthcheck uses: curl -f http://localhost:3000/
- Cleaned up apt cache to keep image size minimal
2026-01-31 13:34:51 +01:00

44 lines
899 B
Docker

# Build stage
FROM node:20-slim AS builder
WORKDIR /app
# Dependencies
COPY package.json package-lock.json* ./
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
# Source code
COPY . .
# Build
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
# Production stage
FROM node:20-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# curl installieren (fuer Health-Check)
RUN apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/*
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
# Copy standalone build
COPY --from=builder /app/public ./public
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
CMD ["node", "server.js"]