35 lines
1.0 KiB
Docker
35 lines
1.0 KiB
Docker
# Lunch — ein Abbild für Oberfläche, Server und Migrationen (E-0004).
|
|
FROM node:22-alpine AS deps
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
|
|
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
COPY --from=deps /app/node_modules ./node_modules
|
|
COPY . .
|
|
# Keine Telemetrie, keine Schriften vom CDN: Geist liegt im Paket `geist`.
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
RUN npm run build
|
|
|
|
FROM node:22-alpine AS runtime
|
|
WORKDIR /app
|
|
ENV NODE_ENV=production \
|
|
NEXT_TELEMETRY_DISABLED=1 \
|
|
HOSTNAME=0.0.0.0 \
|
|
PORT=3000
|
|
|
|
COPY --from=build /app/public ./public
|
|
COPY --from=build /app/.next/standalone ./
|
|
COPY --from=build /app/.next/static ./.next/static
|
|
# Für den Vorlauf-Container (olares/templates/deployment.yaml): pg liegt
|
|
# schon im standalone-Baum, weil der Server es benutzt.
|
|
COPY --from=build /app/scripts/migrate.mjs ./scripts/migrate.mjs
|
|
COPY --from=build /app/scripts/seed.mjs ./scripts/seed.mjs
|
|
COPY --from=build /app/db/migrations ./db/migrations
|
|
COPY --from=build /app/db/seed ./db/seed
|
|
|
|
USER 1000
|
|
EXPOSE 3000
|
|
CMD ["node", "server.js"]
|