mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-12-04 06:54:28 +00:00
initial commit
This commit is contained in:
+47
@@ -0,0 +1,47 @@
|
||||
# Stage 1: Builder
|
||||
FROM oven/bun:1 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package.json bun.lock ./
|
||||
COPY prisma ./prisma
|
||||
|
||||
# Install dependencies (including devDependencies for build tools)
|
||||
RUN bun install --frozen-lockfile
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build API and Worker
|
||||
RUN bun run build.ts
|
||||
|
||||
# Stage 2: Runner
|
||||
FROM oven/bun:1 AS runner
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install ffmpeg/ffprobe
|
||||
COPY --from=mwader/static-ffmpeg:8.1 /ffmpeg /usr/local/bin/
|
||||
COPY --from=mwader/static-ffmpeg:8.1 /ffprobe /usr/local/bin/
|
||||
|
||||
# Copy sharp/img from builder (they are native and already installed)
|
||||
COPY --from=builder /app/node_modules/sharp ./node_modules/sharp
|
||||
COPY --from=builder /app/node_modules/@img ./node_modules/@img
|
||||
|
||||
# Manually install temporalio packages and prisma
|
||||
# These need native bindings or CLI access in the runner environment
|
||||
RUN bun add @temporalio/activity @temporalio/client @temporalio/worker @temporalio/workflow && \
|
||||
bun add --dev --omit peer prisma
|
||||
|
||||
# Copy build artifacts and prisma config
|
||||
COPY --from=builder /app/dist ./
|
||||
COPY --from=builder /app/prisma ./prisma
|
||||
COPY --from=builder /app/prisma.config.ts.prod ./prisma.config.ts
|
||||
|
||||
# Expose port (Bun Hono defaults to 3000)
|
||||
EXPOSE 3000
|
||||
|
||||
# Default command: run migrations and start API server
|
||||
# Can be overridden to run workers: bun worker-cli.js [domain]
|
||||
CMD ["sh", "-c", "bun prisma migrate deploy && bun index.js serve"]
|
||||
Reference in New Issue
Block a user