diff --git a/Dockerfile b/Dockerfile index d04e001..9d4a769 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,10 @@ -# Stage 1: Dependencies (Ubuntu base) -FROM node:20-bookworm AS deps +FROM node:20-alpine AS deps WORKDIR /app COPY package.json package-lock.json ./ RUN npm ci -# Stage 2: Build -FROM node:20-bookworm AS builder +FROM node:20-alpine AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . @@ -24,23 +22,14 @@ RUN npx prisma generate RUN npm run build -# Stage 3: Runner (Ubuntu base) -FROM node:20-bookworm AS runner +FROM node:20-alpine AS runner WORKDIR /app ENV NODE_ENV=production -# Install dependencies for all features -# - gdal/ogr2ogr for GeoPackage export -# - ghostscript+qpdf for extreme PDF compression -# - libredwg for DWG→DXF conversion -RUN apt-get update && \ - apt-get install -y --no-install-recommends \ - gdal-bin ghostscript qpdf build-essential git ca-certificates libredwg-tools && \ - rm -rf /var/lib/apt/lists/* +RUN apk add --no-cache gdal gdal-tools ghostscript qpdf -# Note: DWG→DXF conversion now enabled via libredwg (dwg2dxf) -# If libredwg-tools is missing, manual build from source may be required +# Note: DWG→DXF conversion not available in Alpine (libredwg missing) RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs