drexel_metadata_app / Dockerfile
johnbradley's picture
Add docker container for more robust app
d8b200a
raw
history blame
No virus
786 Bytes
FROM python:3.9
# Add settings taken from huggingface default container.
WORKDIR /home/user/app
RUN useradd -m -u 1000 user
RUN apt-get update && apt-get install -y \
git git-lfs ffmpeg libsm6 libxext6 \
cmake libgl1-mesa-glx \
&& rm -rf /var/lib/apt/lists/* \
&& git lfs install
# Use older setuptools to avoid 2to3 error with dependencies.
RUN pip install 'setuptools<58'
# Install drexel_metadata dependencies
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
# Install gradio after main dependencies to prevent
# `cannot import name 'deprecated' from 'typing_extensions'` error.
RUN pip install gradio
# Cache matplotlib fonts to improve startup time.
RUN python -c "import matplotlib.pyplot"
COPY . /home/user/app
CMD python app.py