-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile.e2e
44 lines (34 loc) · 1.12 KB
/
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
# This docker file is to simulate the CI environment on github actions
# Sometimes testing in there takes too long so this might be useful for debugging e2e tests
# To run this, you can do the following:
#
# docker build -f ./Dockerfile.e2e --build-arg PAGE=mission-page -t e2e-mission-page .
# docker run --init e2e-mission-page
FROM mcr.microsoft.com/playwright:v1.39.0-jammy AS base
ENV CI=true
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable
FROM base AS builder
ARG PAGE
WORKDIR /app
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install -g turbo
COPY . .
RUN turbo prune ${PAGE} --docker
RUN rm -rf /app/out/full/*/*/node_modules
FROM base AS installer
WORKDIR /app
COPY .gitignore .gitignore
COPY --from=builder /app/out/json/ .
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
RUN pnpm exec playwright install
# Build the project
WORKDIR /app
ARG PAGE
COPY --from=builder /app/out/full .
ENV NEXT_PUBLIC_ENABLE_TESTNET=true
RUN pnpm turbo run build --filter=${PAGE}
FROM base AS runner
WORKDIR /app
COPY --from=installer /app .
CMD ["xvfb-run","pnpm", "test:e2e"]