diff --git a/api/Dockerfile b/api/Dockerfile index 1111432..468ab84 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -1,5 +1,7 @@ -FROM mcr.microsoft.com/playwright -FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11 +FROM ubuntu:22.04 + +# Prevent dialog prompts during package installation +ENV DEBIAN_FRONTEND=noninteractive # set work directory WORKDIR /app @@ -8,6 +10,21 @@ WORKDIR /app ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 +# Install system tools, Python, FastAPI essentials, and Playwright's dependencies +RUN apt-get update && apt-get install -y \ + wget \ + python3.11 \ + python3-pip \ + python3-venv \ + libgtk-3-0 \ + libdbus-glib-1-2 \ + libnss3 \ + libxss1 \ + libasound2 \ + ffmpeg \ + gunicorn \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + # copy project COPY api ./api COPY config ./config @@ -20,13 +37,10 @@ COPY index ./index COPY setup.py . COPY requirements.txt . -# install dependencies +# install pyhton dependencies RUN pip install -r requirements.txt + +# install playwright and dependencies RUN python setup.py install RUN playwright install RUN playwright install-deps - -# install ffmpeg -RUN apt-get -y update -RUN apt-get -y upgrade -RUN apt-get install -y ffmpeg diff --git a/worker/Dockerfile b/worker/Dockerfile index 1111432..468ab84 100644 --- a/worker/Dockerfile +++ b/worker/Dockerfile @@ -1,5 +1,7 @@ -FROM mcr.microsoft.com/playwright -FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11 +FROM ubuntu:22.04 + +# Prevent dialog prompts during package installation +ENV DEBIAN_FRONTEND=noninteractive # set work directory WORKDIR /app @@ -8,6 +10,21 @@ WORKDIR /app ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 +# Install system tools, Python, FastAPI essentials, and Playwright's dependencies +RUN apt-get update && apt-get install -y \ + wget \ + python3.11 \ + python3-pip \ + python3-venv \ + libgtk-3-0 \ + libdbus-glib-1-2 \ + libnss3 \ + libxss1 \ + libasound2 \ + ffmpeg \ + gunicorn \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + # copy project COPY api ./api COPY config ./config @@ -20,13 +37,10 @@ COPY index ./index COPY setup.py . COPY requirements.txt . -# install dependencies +# install pyhton dependencies RUN pip install -r requirements.txt + +# install playwright and dependencies RUN python setup.py install RUN playwright install RUN playwright install-deps - -# install ffmpeg -RUN apt-get -y update -RUN apt-get -y upgrade -RUN apt-get install -y ffmpeg diff --git a/worker/Dockerfile.gpu_accelerated b/worker/Dockerfile.gpu_accelerated index cab4f86..5b806c1 100644 --- a/worker/Dockerfile.gpu_accelerated +++ b/worker/Dockerfile.gpu_accelerated @@ -1,5 +1,7 @@ -FROM mcr.microsoft.com/playwright -FROM tiangolo/uvicorn-gunicorn-fastapi:python3.11 +FROM ubuntu:22.04 + +# Prevent dialog prompts during package installation +ENV DEBIAN_FRONTEND=noninteractive # set work directory WORKDIR /app @@ -8,6 +10,21 @@ WORKDIR /app ENV PYTHONDONTWRITEBYTECODE 1 ENV PYTHONUNBUFFERED 1 +# Install system tools, Python, FastAPI essentials, and Playwright's dependencies +RUN apt-get update && apt-get install -y \ + wget \ + python3.11 \ + python3-pip \ + python3-venv \ + libgtk-3-0 \ + libdbus-glib-1-2 \ + libnss3 \ + libxss1 \ + libasound2 \ + ffmpeg \ + gunicorn \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + # copy project COPY api ./api COPY config ./config @@ -20,17 +37,14 @@ COPY index ./index COPY setup.py . COPY requirements.txt . -# install dependencies +# install pyhton dependencies RUN pip install -r requirements.txt + +# install playwright and dependencies RUN python setup.py install RUN playwright install RUN playwright install-deps -# install ffmpeg -RUN apt-get -y update -RUN apt-get -y upgrade -RUN apt-get install -y ffmpeg - # Install GPU drivers RUN pip uninstall torch -y RUN pip cache purge