The open-source CapCut alternative
refactor(docker): update Dockerfile and docker-compose for improved build process and add health check API
ga1az547f566fc204
diff --git a/apps/web/Dockerfile b/apps/web/Dockerfileindex ca1f0987..49820e78 100644--- a/apps/web/Dockerfile+++ b/apps/web/Dockerfile@@ -1,16 +1,27 @@-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 applicationFROM 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 NODE_ENV=production+ENV NEXT_TELEMETRY_DISABLED=1++WORKDIR /app/apps/webRUN bun run build# Production image@@ -18,13 +29,16 @@ FROM base AS runnerWORKDIR /appENV NODE_ENV=production+ENV NEXT_TELEMETRY_DISABLED=1RUN addgroup --system --gid 1001 nodejsRUN 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 appsUSER nextjs@@ -33,4 +47,4 @@ EXPOSE 3000ENV PORT=3000ENV 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 filediff --git a/apps/web/next.config.ts b/apps/web/next.config.tsindex de7fefe2..319ca134 100644--- a/apps/web/next.config.ts+++ b/apps/web/next.config.ts@@ -6,6 +6,7 @@ const nextConfig: NextConfig = {},reactStrictMode: true,productionBrowserSourceMaps: true,+ output: "standalone",};export default nextConfig;diff --git a/apps/web/src/app/api/health/route.ts b/apps/web/src/app/api/health/route.tsnew file mode 100644index 00000000..ecb9ce04--- /dev/null+++ b/apps/web/src/app/api/health/route.ts@@ -0,0 +1,5 @@+import { NextRequest } from "next/server";++export async function GET(request: NextRequest) {+ return new Response("OK", { status: 200 });+}diff --git a/docker-compose.yaml b/docker-compose.yamlindex f5973f3a..e3fc55ac 100644--- a/docker-compose.yaml+++ b/docker-compose.yaml@@ -48,7 +48,7 @@ services:start_period: 10sweb:build:- context: ./apps/web+ context: .dockerfile: ./apps/web/Dockerfilerestart: unless-stoppedports: