-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIOTD.Dockerfile
More file actions
31 lines (23 loc) · 783 Bytes
/
IOTD.Dockerfile
File metadata and controls
31 lines (23 loc) · 783 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
FROM oven/bun:1-alpine AS base
# Install dependencies only when needed
FROM base AS deps
WORKDIR /app
# Install dependencies
COPY package.json bun.lock ./
RUN bun install --frozen-lockfile
# Rebuild the source code only when needed
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN bunx esbuild --bundle --platform=node src/jobs/rotate-invention.ts --minify --format=esm --outfile=dist/rotate-invention.js
FROM base AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV TZ=America/New_York
# Disable telemetry
ENV NEXT_TELEMETRY_DISABLED=1
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder /app/dist .
CMD ["bun", "rotate-invention.js"]