-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.playwright
45 lines (30 loc) · 1.23 KB
/
Dockerfile.playwright
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
# pull playwright docker image
# Install dependencies only when needed
FROM --platform=$BUILDPLATFORM node:20-alpine AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
RUN npm install -g pnpm@9.1.4
COPY . .
RUN pnpm install --frozen-lockfile
FROM mcr.microsoft.com/playwright:v1.47.1-focal
WORKDIR /app
ARG TEST_USER="playwright"
RUN npm install -g pnpm@9.1.4
# Install vim for debugging
RUN apt-get update
RUN apt-get install vim -y
COPY --from=builder --chown=playwright:nodejs /app/node_modules ./node_modules
COPY --from=builder --chown=playwright:nodejs /app/apps/console ./apps/console
COPY --from=builder --chown=playwright:nodejs /app/entrypoint-playwright.sh ./
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 playwright
RUN mkdir public
USER ${TEST_USER}
RUN echo "test user: $TEST_USER"
# Permisions to execute script
RUN chmod +x ./entrypoint-playwright.sh
RUN chmod +x ./apps/console/next-env.mjs
# We need this permission for env.sh to create the __env.js in /public folder
RUN chmod +wx ./apps/console/public
RUN chmod +rwx ./apps/console/.env