diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..eee67d6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,29 @@ +FROM oven/bun:1 as builder + +WORKDIR /app + +# Copy the entire repo +COPY . . + +# Install dependencies for API +WORKDIR /app/apps/api +RUN bun install --frozen-lockfile + +# Production image +FROM oven/bun:1-slim + +WORKDIR /app + +# Copy from builder +COPY --from=builder /app/apps/api/node_modules ./node_modules +COPY --from=builder /app/apps/api/package.json ./ +COPY --from=builder /app/apps/api/src ./src +COPY --from=builder /app/apps/api/drizzle.config.ts ./ + +# Set environment +ENV NODE_ENV=production +ENV PORT=3001 + +EXPOSE 3001 + +CMD ["sh", "-c", "bun run db:push && bun run start"]