From 54590fc94c71006b1ab1939a12c09367c91f79d5 Mon Sep 17 00:00:00 2001 From: Hammer Date: Wed, 28 Jan 2026 16:45:46 +0000 Subject: [PATCH] Add unified Dockerfile with build targets --- Dockerfile.all | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 Dockerfile.all diff --git a/Dockerfile.all b/Dockerfile.all new file mode 100644 index 0000000..8d4e462 --- /dev/null +++ b/Dockerfile.all @@ -0,0 +1,31 @@ +# ========== API Build ========== +FROM oven/bun:1 as api-builder +WORKDIR /app +COPY . . +WORKDIR /app/apps/api +RUN bun install --frozen-lockfile + +FROM oven/bun:1-slim as api +WORKDIR /app +COPY --from=api-builder /app/apps/api/node_modules ./node_modules +COPY --from=api-builder /app/apps/api/package.json ./ +COPY --from=api-builder /app/apps/api/src ./src +COPY --from=api-builder /app/apps/api/drizzle.config.ts ./ +ENV NODE_ENV=production +ENV PORT=3001 +EXPOSE 3001 +CMD ["sh", "-c", "bun run db:push && bun run start"] + +# ========== Web Build ========== +FROM oven/bun:1 as web-builder +WORKDIR /app +COPY . . +WORKDIR /app/apps/web +RUN bun install +RUN bun run build + +FROM nginx:alpine as web +COPY --from=web-builder /app/apps/web/dist /usr/share/nginx/html +COPY --from=web-builder /app/apps/web/nginx.conf /etc/nginx/conf.d/default.conf +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"]