Spaces:
Sleeping
Sleeping
ezequiellopez
commited on
Commit
·
92b5340
1
Parent(s):
86e971c
using CUDA image
Browse files- Dockerfile +16 -3
Dockerfile
CHANGED
@@ -1,5 +1,9 @@
|
|
1 |
# Dockerfile
|
2 |
-
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
|
|
|
|
|
|
|
|
|
3 |
|
4 |
# Set environment variables to prevent Python from writing pyc files to disk
|
5 |
# and to force unbuffered output (useful for Docker)
|
@@ -14,10 +18,19 @@ RUN useradd -m -u 1000 user
|
|
14 |
|
15 |
# Switch to the "user" user
|
16 |
USER user
|
17 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
# Set the working directory in the container
|
20 |
-
WORKDIR /app
|
21 |
|
22 |
# Upgrade pip to the latest version and install Python dependencies
|
23 |
COPY --chown=user requirements.txt .
|
|
|
1 |
# Dockerfile
|
2 |
+
#FROM tiangolo/uvicorn-gunicorn-fastapi:python3.9
|
3 |
+
FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
|
4 |
+
|
5 |
+
ARG DEBIAN_FRONTEND=noninteractive
|
6 |
+
ENV PYTHONUNBUFFERED=1
|
7 |
|
8 |
# Set environment variables to prevent Python from writing pyc files to disk
|
9 |
# and to force unbuffered output (useful for Docker)
|
|
|
18 |
|
19 |
# Switch to the "user" user
|
20 |
USER user
|
21 |
+
# Set home to the user's home directory
|
22 |
+
ENV HOME=/home/user \
|
23 |
+
PATH=/home/user/.local/bin:$PATH \
|
24 |
+
PYTHONPATH=$HOME/app \
|
25 |
+
PYTHONUNBUFFERED=1 \
|
26 |
+
GRADIO_ALLOW_FLAGGING=never \
|
27 |
+
GRADIO_NUM_PORTS=1 \
|
28 |
+
GRADIO_SERVER_NAME=0.0.0.0 \
|
29 |
+
GRADIO_THEME=huggingface \
|
30 |
+
SYSTEM=spaces
|
31 |
|
32 |
# Set the working directory in the container
|
33 |
+
WORKDIR $HOME/app
|
34 |
|
35 |
# Upgrade pip to the latest version and install Python dependencies
|
36 |
COPY --chown=user requirements.txt .
|