Skip to content

Commit

Permalink
change base image of dockerfiles to ubuntu 22.04
Browse files Browse the repository at this point in the history
  • Loading branch information
nattvara committed Sep 9, 2023
1 parent 18b561d commit 35759c1
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 24 deletions.
30 changes: 22 additions & 8 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
30 changes: 22 additions & 8 deletions worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
30 changes: 22 additions & 8 deletions worker/Dockerfile.gpu_accelerated
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 35759c1

Please sign in to comment.