summaryrefslogtreecommitdiff
path: root/apps/web/Dockerfile
diff options
context:
space:
mode:
authorMaze Winther <mazewinther@gmail.com>2025-06-25 16:18:00 +0200
committerMaze Winther <mazewinther@gmail.com>2025-06-25 16:18:00 +0200
commit0ae852c185d5d3ff0bd94310bd8000de8bed5ccc (patch)
tree008549c7b27e3bfe7a6bcf265609b36a1e8ca855 /apps/web/Dockerfile
parentdb603543494cc55372191d723f1817e9c4f4b383 (diff)
parent067b6e3d7373d37dbc4542acf9f2ecce1dc1b9f6 (diff)
downloadopencut-0ae852c185d5d3ff0bd94310bd8000de8bed5ccc.tar.gz
Merge branch 'main' of https://github.com/mazeincoding/AppCut
Diffstat (limited to 'apps/web/Dockerfile')
-rw-r--r--apps/web/Dockerfile43
1 files changed, 28 insertions, 15 deletions
diff --git a/apps/web/Dockerfile b/apps/web/Dockerfile
index ca1f0987..8b13ce38 100644
--- a/apps/web/Dockerfile
+++ b/apps/web/Dockerfile
@@ -1,30 +1,43 @@
-FROM oven/bun:latest AS base
+FROM oven/bun:alpine AS base
-# Install dependencies
-FROM base AS deps
-WORKDIR /app
-COPY package.json bun.lock ./
-RUN bun install --frozen-lockfile
-
-# Build the application
+# Install dependencies and build the application
FROM base AS builder
+
WORKDIR /app
-COPY --from=deps /app/node_modules ./node_modules
-COPY . .
+
+COPY package.json package.json
+COPY bun.lock bun.lock
+COPY turbo.json turbo.json
+
+COPY apps/web/package.json apps/web/package.json
+COPY packages/db/package.json packages/db/package.json
+COPY packages/auth/package.json packages/auth/package.json
+
+RUN bun install
+
+COPY apps/web/ apps/web/
+COPY packages/db/ packages/db/
+COPY packages/auth/ packages/auth/
+
+ENV NEXT_TELEMETRY_DISABLED=1
+
+WORKDIR /app/apps/web
RUN bun run build
# Production image
FROM base AS runner
WORKDIR /app
-ENV NODE_ENV=production
+ENV NEXT_TELEMETRY_DISABLED=1
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs
-COPY --from=builder /app/public ./public
-COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
-COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
+COPY --from=builder --chown=nextjs:nodejs /app/apps/web/public ./apps/web/public
+COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/standalone ./
+COPY --from=builder --chown=nextjs:nodejs /app/apps/web/.next/static ./apps/web/.next/static
+
+RUN chown nextjs:nodejs apps
USER nextjs
@@ -33,4 +46,4 @@ EXPOSE 3000
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
-CMD ["bun", "server.js"] \ No newline at end of file
+CMD ["bun", "apps/web/server.js"] \ No newline at end of file