Closed kbzowski closed 3 years ago
Nice! I think this happens because of missing sqlite Ubuntu package.
Nothing changed after sqlite3
installation via apt in Dockerfile. I think playwright still missing something to work. I will experiment with: https://github.com/ianwalter/playwright-container/blob/main/Dockerfile maybe I will find what is missing.
Full success :)
FROM ubuntu:20.04
RUN apt-get update && \
apt-get install --no-install-recommends -y \
python3.9\
python3-pip\
libglib2.0-0\
libnss3\
libnspr4\
libatk1.0-0\
libatk-bridge2.0-0\
libcups2\
libdbus-1-3\
libxcb1\
libdrm2\
libxkbcommon0\
libx11-6\
libxcomposite1\
libxdamage1\
libxext6\
libxfixes3\
libxrandr2\
libgbm1\
libgtk-3-0\
libpango-1.0-0\
libcairo2\
libgdk-pixbuf2.0-0\
libasound2\
libatspi2.0-0 \
libxshmfence1 \
sqlite3 \
libwoff1 \
libopus0 \
libwebpdemux2 \
libenchant1c2a \
libhyphen0 \
libegl1 \
libnotify4 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /usr/src/app
COPY . .
RUN pip3 install .
RUN playwright install chromium
#Fixing: https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1899343
RUN echo "Etc/UTC" > /etc/timezone
EXPOSE 8080
ENTRYPOINT ["./start.sh"]
I will try to make the image smaller and more "configurable" and make PR
Full success :)
FROM ubuntu:20.04 RUN apt-get update && \ apt-get install --no-install-recommends -y \ python3.9\ python3-pip\ libglib2.0-0\ libnss3\ libnspr4\ libatk1.0-0\ libatk-bridge2.0-0\ libcups2\ libdbus-1-3\ libxcb1\ libdrm2\ libxkbcommon0\ libx11-6\ libxcomposite1\ libxdamage1\ libxext6\ libxfixes3\ libxrandr2\ libgbm1\ libgtk-3-0\ libpango-1.0-0\ libcairo2\ libgdk-pixbuf2.0-0\ libasound2\ libatspi2.0-0 \ libxshmfence1 \ sqlite3 \ libwoff1 \ libopus0 \ libwebpdemux2 \ libenchant1c2a \ libhyphen0 \ libegl1 \ libnotify4 \ && rm -rf /var/lib/apt/lists/* WORKDIR /usr/src/app COPY . . RUN pip3 install . RUN playwright install chromium #Fixing: https://bugs.launchpad.net/ubuntu/+source/tzdata/+bug/1899343 RUN echo "Etc/UTC" > /etc/timezone EXPOSE 8080 ENTRYPOINT ["./start.sh"]
I will try to make the image smaller and more "configurable" and make PR
Awesome! I have tried to make a working Dockerfile in docker branch but faced many missing dependencies of playwright and didn't find time to do trial and error. Thanks for your contributions!
You might find these useful. They was a great help while trying in docker branch. https://github.com/tiangolo/uvicorn-gunicorn-fastapi-docker/ https://github.com/adamwojt/ur_l/blob/master/python_docker/Dockerfile
Please feel free to change anything that you wish. I am not a docker expert :)
After my problems with running on Windows, I took a shot at containerizing the application in Docker.
Dockerfile:
start.sh:
Any idea, why application hangs on:
I tried to move "python3 -m facebook_rss --login -u [login] -p [pass]" to RUN in Dockerfile - same thing. Missing playwright dependencies were deduced by trial and errors. Fortunately, playwright reports what it is missing.