Skip to content

Commit 719f242

Browse files
committed
fix: missing playwright browsers into the production image
1 parent 06b0c04 commit 719f242

File tree

4 files changed

+9
-3
lines changed

4 files changed

+9
-3
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
version: '2.14.2'
113113
- name: Install `Xvfb` and others to run browsers for end-to-end testing in local CI/CD simulations (https://github.com/nektos/act/issues/1300#issuecomment-1387344639)
114114
if: ${{ env.ACT }}
115-
run: sudo apt-get update && sudo apt-get install -y xvfb && npx playwright install-deps
115+
run: sudo apt-get update && sudo apt-get install -y xvfb && npm run playwright install-deps
116116

117117
- name: Test unit
118118
run: make test-unit

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ARG NODE_VERSION=18.19.0
55
ARG RUBY_VERSION=3.2.2-r1
66
ARG PIP_VERSION=23.3.1-r0
77
ARG PRISMA_VERSION=4.16.2
8+
ARG PLAYWRIGHT_VERSION=1.39.0
89
ARG APP_HOST=172.17.0.2
910
ARG PORT=3000
1011

@@ -13,6 +14,7 @@ FROM node:${NODE_VERSION}-alpine
1314
ARG RUBY_VERSION
1415
ARG PIP_VERSION
1516
ARG PRISMA_VERSION
17+
ARG PLAYWRIGHT_VERSION
1618
ARG APP_HOST
1719
ARG PORT
1820

@@ -58,6 +60,9 @@ RUN python3 -m venv ./venv \
5860

5961
ENV PATH="/app/venv/bin:$PATH"
6062

63+
# We use `npx` to install browsers needed to avoid using `npm run playwright install` since we build as standalone the entire application and we no longer want to rely application `node_modules` folder
64+
RUN npx --yes playwright@${PLAYWRIGHT_VERSION} install
65+
6166
# Manage the final server build
6267

6368
COPY --chown=nextjs:nodejs ".next/standalone" ./

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"db:studio:unsecure": "prisma studio",
7171
"clean": "rm -rf .next && rm -rf node_modules",
7272
"chromatic": "only-include-used-icons && chromatic --build-script-name build:storybook:command --auto-accept-changes --exit-zero-on-changes --only-changed --externals \"public/**\"",
73+
"playwright": "playwright",
7374
"jest": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest"
7475
},
7576
"prisma": {
@@ -125,7 +126,7 @@
125126
"openai": "^4.25.0",
126127
"parse-domain": "^8.0.1",
127128
"pg-boss": "^9.0.1",
128-
"playwright": "^1.39.0",
129+
"playwright": "1.39.0",
129130
"pretty-bytes": "^6.1.1",
130131
"prisma": "4.16.2",
131132
"react": "^18.2.0",

0 commit comments

Comments
 (0)