-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
22 lines (20 loc) · 725 Bytes
/
Dockerfile
File metadata and controls
22 lines (20 loc) · 725 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM oven/bun:1.3.11-slim AS builder
WORKDIR /app
COPY package.json bun.lock ./
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
RUN bun install --frozen-lockfile
COPY src/ ./src/
RUN bun build src/index.ts --outfile dist/index.js --target bun --external playwright
FROM oven/bun:1.3.11-slim AS prod-deps
WORKDIR /app
COPY package.json bun.lock ./
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
RUN bun install --frozen-lockfile --production
FROM mcr.microsoft.com/playwright:v1.59.1-noble AS runner
WORKDIR /app
COPY --from=oven/bun:1.3.11-slim /usr/local/bin/bun /usr/local/bin/bun
COPY --from=prod-deps /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
EXPOSE 8081
ENV NODE_ENV=production
CMD ["bun", "dist/index.js"]