2025-10-25 01:37:05 +00:00
|
|
|
# Use bun as the base image
|
2025-10-25 01:55:59 +00:00
|
|
|
FROM oven/bun:latest AS deps
|
2025-10-25 01:37:05 +00:00
|
|
|
# Install dependencies only when needed
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
2025-10-25 01:59:19 +00:00
|
|
|
COPY package.json next.config.ts ./
|
2025-10-25 01:37:05 +00:00
|
|
|
|
2025-10-25 01:47:15 +00:00
|
|
|
# Install dependencies including devDependencies
|
2025-10-25 01:55:59 +00:00
|
|
|
RUN bun install --frozen-lockfile
|
2025-10-25 01:37:05 +00:00
|
|
|
|
|
|
|
|
# Build the application
|
2025-10-25 01:55:59 +00:00
|
|
|
FROM oven/bun:latest AS builder
|
2025-10-25 01:37:05 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
2025-10-25 01:55:59 +00:00
|
|
|
# Copy dependencies and config files
|
2025-10-25 01:37:05 +00:00
|
|
|
COPY --from=deps /app/node_modules ./node_modules
|
2025-10-25 01:55:59 +00:00
|
|
|
COPY --from=deps /app/package.json ./
|
2025-10-25 02:02:08 +00:00
|
|
|
COPY --from=deps /app/next.config.ts ./
|
2025-10-25 01:55:59 +00:00
|
|
|
|
|
|
|
|
# Copy source code
|
2025-10-25 01:37:05 +00:00
|
|
|
COPY . .
|
|
|
|
|
|
2025-10-25 01:55:59 +00:00
|
|
|
|
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
ENV NEXT_TELEMETRY_DISABLED=1
|
|
|
|
|
ENV SKIP_ENV_VALIDATION=1
|
|
|
|
|
ENV BETTER_AUTH_TELEMETRY=0
|
|
|
|
|
|
|
|
|
|
|
2025-10-25 01:37:05 +00:00
|
|
|
# Build Next.js application
|
|
|
|
|
RUN bun run build
|
|
|
|
|
|
|
|
|
|
# Production image
|
2025-10-25 01:58:06 +00:00
|
|
|
FROM oven/bun:latest AS runner
|
2025-10-25 01:37:05 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
|
|
|
|
|
|
2025-10-25 01:55:59 +00:00
|
|
|
# Copy Next.js build artifacts
|
2025-10-25 01:37:05 +00:00
|
|
|
COPY --from=builder /app/.next/standalone ./
|
|
|
|
|
COPY --from=builder /app/.next/static ./.next/static
|
2025-10-25 01:55:59 +00:00
|
|
|
COPY --from=builder /app/public ./public
|
|
|
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
|
|
|
COPY --from=builder /app/package.json ./
|
2025-10-25 02:02:08 +00:00
|
|
|
COPY --from=builder /app/next.config.ts ./
|
2025-10-25 01:55:59 +00:00
|
|
|
|
|
|
|
|
ENV TZ="CET"
|
|
|
|
|
ENV LANG="de_DE.UTF-8"
|
|
|
|
|
ENV LANGUAGE="de_DE:de"
|
|
|
|
|
ENV LC_ALL="de_DE.UTF-8"
|
|
|
|
|
ENV PORT=3000
|
2025-10-25 01:37:05 +00:00
|
|
|
|
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Start the application
|
2025-10-25 01:55:59 +00:00
|
|
|
CMD ["bun", "server.js"]
|
2025-10-25 01:37:05 +00:00
|
|
|
|