Update Dockerfile
Browse files- Dockerfile +44 -44
Dockerfile
CHANGED
|
@@ -1,44 +1,44 @@
|
|
| 1 |
-
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
|
| 2 |
-
|
| 3 |
-
FROM python:3.11-slim-bullseye
|
| 4 |
-
|
| 5 |
-
WORKDIR /app
|
| 6 |
-
|
| 7 |
-
# Enable contrib and non-free repos, and install system dependencies
|
| 8 |
-
RUN sed -i 's/main/main contrib non-free/' /etc/apt/sources.list && \
|
| 9 |
-
apt-get update && \
|
| 10 |
-
apt-get install -y --no-install-recommends \
|
| 11 |
-
unrar \
|
| 12 |
-
libgl1 \
|
| 13 |
-
libglib2.0-0 \
|
| 14 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
ENV DEBIAN_FRONTEND=noninteractive
|
| 18 |
-
|
| 19 |
-
# Python + dependencies
|
| 20 |
-
RUN apt-get update && apt-get install -y python3 python3-pip git && \
|
| 21 |
-
pip3 install --upgrade pip
|
| 22 |
-
|
| 23 |
-
# Set working dir
|
| 24 |
-
WORKDIR /app
|
| 25 |
-
|
| 26 |
-
# Copy and install requirements
|
| 27 |
-
COPY requirements.txt ./
|
| 28 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 29 |
-
|
| 30 |
-
# Copy app code
|
| 31 |
-
COPY . .
|
| 32 |
-
|
| 33 |
-
# ybyjngamhtcuaupc gsmt
|
| 34 |
-
|
| 35 |
-
# Make the entire /app directory fully writeable for all users
|
| 36 |
-
RUN chmod -R 777 /app
|
| 37 |
-
|
| 38 |
-
# Ensure the app runs as the same user as the Space UI
|
| 39 |
-
RUN useradd -m -u 1000 user
|
| 40 |
-
USER user
|
| 41 |
-
|
| 42 |
-
# Launch FastAPI download server on container start
|
| 43 |
-
CMD ["uvicorn", "
|
| 44 |
-
|
|
|
|
| 1 |
+
FROM nvidia/cuda:11.8.0-runtime-ubuntu22.04
|
| 2 |
+
|
| 3 |
+
FROM python:3.11-slim-bullseye
|
| 4 |
+
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Enable contrib and non-free repos, and install system dependencies
|
| 8 |
+
RUN sed -i 's/main/main contrib non-free/' /etc/apt/sources.list && \
|
| 9 |
+
apt-get update && \
|
| 10 |
+
apt-get install -y --no-install-recommends \
|
| 11 |
+
unrar \
|
| 12 |
+
libgl1 \
|
| 13 |
+
libglib2.0-0 \
|
| 14 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 18 |
+
|
| 19 |
+
# Python + dependencies
|
| 20 |
+
RUN apt-get update && apt-get install -y python3 python3-pip git && \
|
| 21 |
+
pip3 install --upgrade pip
|
| 22 |
+
|
| 23 |
+
# Set working dir
|
| 24 |
+
WORKDIR /app
|
| 25 |
+
|
| 26 |
+
# Copy and install requirements
|
| 27 |
+
COPY requirements.txt ./
|
| 28 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 29 |
+
|
| 30 |
+
# Copy app code
|
| 31 |
+
COPY . .
|
| 32 |
+
|
| 33 |
+
# ybyjngamhtcuaupc gsmt
|
| 34 |
+
|
| 35 |
+
# Make the entire /app directory fully writeable for all users
|
| 36 |
+
RUN chmod -R 777 /app
|
| 37 |
+
|
| 38 |
+
# Ensure the app runs as the same user as the Space UI
|
| 39 |
+
RUN useradd -m -u 1000 user
|
| 40 |
+
USER user
|
| 41 |
+
|
| 42 |
+
# Launch FastAPI download server on container start
|
| 43 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
| 44 |
+
|