Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ coverage
dist
build
.turbo

.pnpm-store

33 changes: 19 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,43 @@
FROM oven/bun:1.2-debian AS base
FROM node:20-slim AS base
WORKDIR /app
ENV NODE_ENV=production
ENV NPM_CONFIG_REGISTRY=https://registry.npmjs.org/
RUN corepack enable && corepack prepare pnpm@9.15.4 --activate

FROM base AS install
RUN mkdir -p /temp/dev
COPY package.json bun.lock /temp/dev/
RUN cd /temp/dev && bun install --frozen-lockfile
WORKDIR /temp/dev
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile

# install with --production (exclude devDependencies)
RUN mkdir -p /temp/prod
COPY package.json bun.lock /temp/prod/
RUN cd /temp/prod && bun install --frozen-lockfile --production
FROM base AS prod-deps
WORKDIR /temp/prod
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --prod

FROM base AS prerelease
COPY --from=install /temp/dev/node_modules node_modules
WORKDIR /app
COPY --from=install /temp/dev/node_modules ./node_modules
COPY . .

# Use Node.js for build (Bun has compatibility issues with Next.js 16 Turbopack)
FROM node:20-slim AS build
FROM base AS build
WORKDIR /app
COPY --from=prerelease /app ./
ARG NEXT_PUBLIC_APP_URL
ARG DATABASE_URL
ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL
ENV DATABASE_URL=$DATABASE_URL
RUN npm run build
RUN pnpm run build

FROM base AS release
FROM node:20-slim AS release
WORKDIR /app
COPY --from=install /temp/prod/node_modules node_modules
ENV NODE_ENV=production
COPY --from=prod-deps /temp/prod/node_modules ./node_modules
COPY --from=build /app/.next/standalone ./
COPY --from=build /app/.next/static ./.next/static/
COPY --from=build /app/public ./public
EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="localhost"
ENV NETWORK="0.0.0.0"
CMD ["bun", "server.js"]
CMD ["node", "server.js"]
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
"drizzle-seed": "^0.3.1",
"drizzle-zod": "^0.8.3",
"embla-carousel-react": "^8.6.0",
"framer-motion": "12.23.0",
"geist": "^1.4.2",
"globals": "^16.0.0",
"ical-generator": "^9.0.0",
Expand Down Expand Up @@ -115,6 +116,7 @@
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4.0.17",
"@types/node": "^22.15.3",
"@types/pg": "^8.16.0",
"@types/react": "^19.1.10",
"@types/react-datepicker": "^6.2.0",
"@types/react-dom": "^19",
Expand Down
Loading