Initial commit
This commit is contained in:
38
apps/web/Dockerfile
Normal file
38
apps/web/Dockerfile
Normal file
@@ -0,0 +1,38 @@
|
||||
# syntax=docker/dockerfile:1
|
||||
|
||||
FROM oven/bun:1.3.3 AS deps
|
||||
WORKDIR /app
|
||||
|
||||
# Workspace manifests (copy all workspace package.json files so Bun
|
||||
# can resolve workspace:* deps without mutating the lockfile).
|
||||
COPY package.json bun.lock tsconfig.base.json ./
|
||||
COPY apps/web/package.json ./apps/web/package.json
|
||||
COPY apps/worker/package.json ./apps/worker/package.json
|
||||
COPY packages/config/package.json ./packages/config/package.json
|
||||
COPY packages/db/package.json ./packages/db/package.json
|
||||
COPY packages/minio/package.json ./packages/minio/package.json
|
||||
COPY packages/queue/package.json ./packages/queue/package.json
|
||||
|
||||
RUN bun install --frozen-lockfile --ignore-scripts
|
||||
|
||||
FROM deps AS builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY apps/web ./apps/web
|
||||
COPY packages ./packages
|
||||
|
||||
# Build Next standalone output
|
||||
RUN bun run --cwd apps/web build
|
||||
|
||||
FROM node:20-bookworm-slim AS runner
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
|
||||
# Next standalone output contains its own node_modules tree.
|
||||
# With outputFileTracingRoot set, standalone output nests under the basename
|
||||
# of that tracing root ("app" inside this Docker build).
|
||||
COPY --from=builder /app/apps/web/.next/standalone ./
|
||||
COPY --from=builder /app/apps/web/.next/static ./app/apps/web/.next/static
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["node", "app/apps/web/server.js"]
|
||||
Reference in New Issue
Block a user