saniaE commited on
Commit ·
1ca543b
1
Parent(s): b8f88c3
updated docker
Browse files- Dockerfile +3 -3
Dockerfile
CHANGED
|
@@ -2,19 +2,18 @@ FROM nvcr.io/nvidia/tensorflow:20.12-tf1-py3
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
-
# Fix GPG Keys
|
| 6 |
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub \
|
| 7 |
&& apt-get update && apt-get install -y \
|
| 8 |
libgl1-mesa-glx \
|
| 9 |
libglib2.0-0 \
|
| 10 |
-
python3.7-dev \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
# Set up user and permissions
|
| 14 |
RUN useradd -m -u 1000 user
|
| 15 |
RUN mkdir -p /home/user/app && chown -R user:user /home/user/app
|
| 16 |
|
| 17 |
-
# Force Python 3.7 paths
|
| 18 |
ENV HOME=/home/user \
|
| 19 |
PATH=/home/user/.local/bin:$PATH \
|
| 20 |
PYTHONPATH=/usr/local/lib/python3.7/dist-packages \
|
|
@@ -31,4 +30,5 @@ COPY --chown=user:user . .
|
|
| 31 |
|
| 32 |
USER user
|
| 33 |
|
|
|
|
| 34 |
CMD ["python3.7", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 2 |
|
| 3 |
USER root
|
| 4 |
|
| 5 |
+
# Fix GPG Keys and install only necessary system graphics/glib libs
|
| 6 |
RUN apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub \
|
| 7 |
&& apt-get update && apt-get install -y \
|
| 8 |
libgl1-mesa-glx \
|
| 9 |
libglib2.0-0 \
|
|
|
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
# Set up user and permissions
|
| 13 |
RUN useradd -m -u 1000 user
|
| 14 |
RUN mkdir -p /home/user/app && chown -R user:user /home/user/app
|
| 15 |
|
| 16 |
+
# Force Python 3.7 paths and HF cache location
|
| 17 |
ENV HOME=/home/user \
|
| 18 |
PATH=/home/user/.local/bin:$PATH \
|
| 19 |
PYTHONPATH=/usr/local/lib/python3.7/dist-packages \
|
|
|
|
| 30 |
|
| 31 |
USER user
|
| 32 |
|
| 33 |
+
# Use python3.7 -m uvicorn to ensure we stay in the TF1.15 environment
|
| 34 |
CMD ["python3.7", "-m", "uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|