FROM mcr.microsoft.com/playwright/python:v1.{lastest_stable_version}-focal # in my case `30.0`
RUN apt-get update && apt-get upgrade -y
RUN apt-get install -y xvfb
RUN apt-get install -qqy x11-apps
# chromium dependencies
RUN apt-get install -y libnss3 \
libxss1 \
libasound2 \
fonts-noto-color-emoji
# additional actions related to your project
ENTRYPOINT ["/bin/sh", "-c", "/usr/bin/xvfb-run -a $@", ""]
docker-compose.yml
service_name:
build: .
init: true
command: # command depending on a project
environment:
- DISPLAY=:0
volumes:
- /tmp/.X11-unix:/tmp/.X11-unix
1条答案
按热度按时间myzjeezk1#
此解决方案对我很有效:
停靠文件:
docker-compose.yml
希望能有所帮助