Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker and playwright

Tags:

python

docker

I need to install playwright inside of docker. This is my dockerfile.

FROM python:3.9

EXPOSE 8000

WORKDIR /fastanalytics

COPY /requirements.txt /fastanalytics/requirements.txt

RUN pip install --no-cache-dir --upgrade -r /fastanalytics/requirements.txt

RUN playwright install
RUN playwright install-deps
RUN apt-get update && apt-get upgrade -y

But when I am installing I got the below error. I tried installing everything in the error message but it didn't help.

E: Package 'ttf-ubuntu-font-family' has no installation candidate
E: Unable to locate package libenchant1c2a
E: Unable to locate package libicu66
E: Package 'libjpeg-turbo8' has no installation candidate

enter image description here

like image 733
Иван Гречка Avatar asked Feb 03 '26 06:02

Иван Гречка


1 Answers

Microsoft released a python docker image for Playwright

Dockerfile

# Build Environment: Playwright
FROM mcr.microsoft.com/playwright/python:v1.21.0-focal

# Add python script to Docker
COPY index.py /

# Run Python script
CMD [ "python", "index.py" ]

Check Playwright - Docker docs for the latest playwright version.

like image 192
wanna_coder101 Avatar answered Feb 05 '26 22:02

wanna_coder101