-
Notifications
You must be signed in to change notification settings - Fork 56
/
Dockerfile.e2e
46 lines (32 loc) · 994 Bytes
/
Dockerfile.e2e
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# deps
FROM node:18-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# builder
FROM node:18 AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
ARG DATABASE_URL
ENV DATABASE_URL=$DATABASE_URL
ENV NEXT_TELEMETRY_DISABLED 1
RUN npx prisma generate
RUN npm run build
# runner
FROM mcr.microsoft.com/playwright:v1.27.1-focal AS runner
WORKDIR /app
COPY --from=builder /app/package.json package.json
COPY --from=builder /app/public public
COPY --from=builder /app/.next .next
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/e2e e2e
COPY --from=builder /app/playwright.config.ts playwright.config.ts
COPY --from=builder /app/node_modules node_modules
EXPOSE 3000
ENV NEXT_TELEMETRY_DISABLED 1
ENV NODE_ENV production
ENV CI true
ENV PORT 3000
CMD ["npm", "run", "docker:e2e:start"]