Files
bikeApp/Dockerfile
T
fegger 947b64b50e Remove .env.example and fix auth cookie secure flag
Delete the environment variable example file. Add error handling to the
Ollama AI route. Update Docker configuration to support Ollama services
and create required image directories. Fix indentation in auth library
and allow overriding secure cookie setting in non-production environments.
2026-05-20 00:39:25 +02:00

38 lines
984 B
Docker

FROM node:20-alpine AS base
RUN apk add --no-cache libc6-compat openssl
FROM base AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci --ignore-scripts
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npx prisma generate
RUN npm run build
FROM base AS runner
WORKDIR /app
ENV NODE_ENV production
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
COPY --from=builder /app/node_modules/prisma ./node_modules/prisma
RUN mkdir -p /app/public/images/user && chown -R nextjs:nodejs /app/public
USER nextjs
EXPOSE 3000
ENV PORT=3000
CMD ["sh", "-c", "node ./node_modules/prisma/build/index.js db push --skip-generate && node server.js"]