However, I always get an error browserType.launch: Executable doesn't exist at /opt/render/.cache/ms-playwright/chromium-1000/chrome-linux/chrome That is playwright dependenacies and chromium won’t install properly.
Damn, I feared that might be the case. Messing around with docker always takes forever.
In case some other poor soul needs to use Node + Playwright, dockerfile worked for me.
# Build Environment: Node + Playwright
FROM node:16
FROM mcr.microsoft.com/playwright:focal
# Env
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
# Export port 3000 for Node
EXPOSE 3000
# Copy all app files into Docker Work directory
COPY package*.json /app/
COPY index.ts /app/
COPY src/ /app/src/
COPY tsconfig.json /app/
# Install Deps
RUN npm install
# Build TS into JS to run via Node
RUN npm run build
# Run Node index.js file
CMD [ "npm", "start" ]