Skip to content

Commit

Permalink
fix: switch again because playwright does not manage proper install i…
Browse files Browse the repository at this point in the history
…nto alpine images, better to rely on official package even if version not aligned exactly
  • Loading branch information
sneko committed Feb 24, 2024
1 parent 74ce747 commit 352b2eb
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ ARG NODE_VERSION=18.19.0
ARG RUBY_VERSION=3.2.2-r1
ARG PIP_VERSION=23.3.1-r0
ARG PRISMA_VERSION=4.16.2
ARG PLAYWRIGHT_VERSION=1.39.0
ARG APP_HOST=172.17.0.2
ARG PORT=3000

Expand All @@ -14,18 +13,31 @@ FROM node:${NODE_VERSION}-alpine
ARG RUBY_VERSION
ARG PIP_VERSION
ARG PRISMA_VERSION
ARG PLAYWRIGHT_VERSION
ARG APP_HOST
ARG PORT

RUN apk add --no-cache \
USER root

RUN apk add \
# This is for the code we manage
"build-base" \
"libffi-dev" \
"libcurl" \
"curl" \
"ruby-dev=${RUBY_VERSION}" \
"py3-pip=${PIP_VERSION}"
RUN apk update
"py3-pip=${PIP_VERSION}" \
# This is the dependencies needed by chromium
"chromium" \
"libstdc++" \
"harfbuzz" \
"nss" \
"freetype" \
"ttf-freefont" \
"font-noto-emoji" \
"wqy-zenhei"

ENV CHROME_BIN="/usr/bin/chromium-browser"
ENV CHROME_PATH="/usr/lib/chromium/"

# Restrict the permissions

Expand Down Expand Up @@ -60,9 +72,6 @@ RUN python3 -m venv ./venv \

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

# We use `npx` to install browsers needed to avoid using `npm run playwright install --with-deps chromium` since we build as standalone the entire application and we no longer want to rely application `node_modules` folder
RUN npx --yes playwright@${PLAYWRIGHT_VERSION} install --with-deps chromium

# Manage the final server build

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

0 comments on commit 352b2eb

Please sign in to comment.