WFDASHDRIVER-APP/Dockerfile
Dave 30c30ed821 feat: invoice match on by default with the WFDASH address built in
The match never ran on drivers' phones: it was off by default and the
build had no WFDASH address, so photos were stored but nothing collected.
Now it is on for every driver (switched on once for phones saved while
it was off; a later "off" sticks) and falls back to wfdash.apphub.co.za.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 10:46:27 +02:00

42 lines
No EOL
1 KiB
Docker

# Multi-stage build for Next.js static export
# Stage 1: Build the app
FROM node:20-alpine AS builder
WORKDIR /app
# Install dependencies (including sharp for icon generation)
COPY package.json package-lock.json ./
RUN npm ci
# Copy source code
COPY . .
# Build argument for PocketBase URL
ARG NEXT_PUBLIC_POCKETBASE_URL
ENV NEXT_PUBLIC_POCKETBASE_URL=${NEXT_PUBLIC_POCKETBASE_URL}
# WFDASH address the invoice match calls (overridable per phone in Settings)
ARG NEXT_PUBLIC_WFDASH_URL=https://wfdash.apphub.co.za
ENV NEXT_PUBLIC_WFDASH_URL=${NEXT_PUBLIC_WFDASH_URL}
# Generate PWA icons
RUN node scripts/generate-icons.js
# Build the static export (sets NEXT_EXPORT=true)
RUN npm run export
# Stage 2: Serve with nginx
FROM nginx:alpine
# Remove default nginx static assets
RUN rm -rf /usr/share/nginx/html/*
# Copy built static files from builder (Next.js export outputs to /out)
COPY --from=builder /app/out /usr/share/nginx/html
# Copy custom nginx config
COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]