Something went wrong. Try again.
An AI-powered SaaS development platform for building, customizing, and deploying modern applications directly from natural language at scal… zentro.arjunkrishna.dev
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
# ------------ Build stage ------------
FROM oven/bun:1 AS baseWORKDIR /app
# Prune stageFROM base AS prunerWORKDIR /appCOPY . .RUN bun install --no-frozen-lockfile --save-text-lockfileRUN bun x turbo prune --scope=worker --docker
# ------------ Installer stage ------------
FROM base AS installerWORKDIR /app
# Copy pruned package.jsons and lockfileCOPY --from=pruner /app/out/json/ .COPY --from=pruner /app/out/bun.lock ./bun.lock
# Install production dependenciesRUN bun install --production --no-frozen-lockfile
# ------------ Runner stage ------------
FROM oven/bun:1-slim AS runnerWORKDIR /app
# Install rclone, cron, nodejs, and npmRUN apt-get update && \ apt-get install -y rclone cron curl && \ curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ apt-get install -y nodejs && \ rm -rf /var/lib/apt/lists/*
# Copy dependenciesCOPY --from=installer /app/node_modules ./node_modulesCOPY --from=installer /app/package.json ./package.jsonCOPY --from=installer /app/bun.lock ./bun.lock
# Copy source codeCOPY --from=pruner /app/out/full/ .COPY apps/worker/.env ./apps/worker/.env
# Copy sync script, filter file, and entrypointCOPY --from=pruner /app/out/full/apps/worker/sync-r2.sh /usr/local/bin/sync-r2.shCOPY --from=pruner /app/out/full/apps/worker/rclone_filters.txt /usr/local/bin/rclone_filters.txtCOPY --from=pruner /app/out/full/apps/worker/entrypoint.sh /usr/local/bin/entrypoint.shRUN chmod +x /usr/local/bin/sync-r2.sh /usr/local/bin/entrypoint.sh
# Create log file for cronRUN touch /var/log/rclone-sync.log
WORKDIR /app/apps/worker
EXPOSE 9091
# Use entrypoint script to setup cron with env vars and start workerCMD ["/usr/local/bin/entrypoint.sh"]