Skip to content

Instantly share code, notes, and snippets.

@jnkwrych
Created April 12, 2024 11:02
Show Gist options
  • Save jnkwrych/c647d8653515dc676f7369507795b9d8 to your computer and use it in GitHub Desktop.
Save jnkwrych/c647d8653515dc676f7369507795b9d8 to your computer and use it in GitHub Desktop.
A simple Dockerfile to run Playwright on Digital Ocean App Platform (not production tested)
# Put this file in the root folder of your node project
FROM node:20
RUN apt-get update && apt-get upgrade -y
# Install Playwright with Dependencies and Chromium only
# This is where a normal Digital Ocean App Platform without Docker fails because you don't have root access
RUN npx -y playwright@1.43.0 install --with-deps chromium
# Set the working directory to /app
WORKDIR /app
# Bundle your app source inside the docker image
COPY . .
# Install all the dependencies
RUN npm ci
RUN npm run build
EXPOSE 8080
CMD [ "npm", "run", "start" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment