Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +8 -11
Dockerfile
CHANGED
@@ -6,7 +6,6 @@ RUN apt-get update -q && \
|
|
6 |
apt-get install -y --no-install-recommends \
|
7 |
python3.9 \
|
8 |
python3-pip \
|
9 |
-
python-is-python3 \ # Ensures 'python' points to 'python3'
|
10 |
libgl1 \
|
11 |
libglib2.0-0 \
|
12 |
wget \
|
@@ -23,27 +22,25 @@ RUN wget -qO /tmp/cuda-keyring.deb \
|
|
23 |
libcublas-12-2=12.2.5.6-1 \
|
24 |
&& rm -rf /var/lib/apt/lists/*
|
25 |
|
26 |
-
# Set working directory
|
27 |
WORKDIR /app
|
28 |
|
29 |
-
#
|
30 |
COPY requirements.txt .
|
31 |
RUN pip install --no-cache-dir -r requirements.txt
|
32 |
|
33 |
-
# Create directories
|
34 |
-
RUN mkdir -p /app/weights
|
35 |
-
|
36 |
|
37 |
-
#
|
38 |
COPY main.py utils.py download_models.py ./
|
39 |
|
40 |
-
# Download models
|
41 |
-
RUN python3 download_models.py
|
42 |
|
43 |
-
# Set up
|
44 |
RUN useradd -m -u 1000 user
|
45 |
USER user
|
46 |
ENV PATH="/home/user/.local/bin:$PATH"
|
47 |
|
48 |
-
# Run the application
|
49 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
6 |
apt-get install -y --no-install-recommends \
|
7 |
python3.9 \
|
8 |
python3-pip \
|
|
|
9 |
libgl1 \
|
10 |
libglib2.0-0 \
|
11 |
wget \
|
|
|
22 |
libcublas-12-2=12.2.5.6-1 \
|
23 |
&& rm -rf /var/lib/apt/lists/*
|
24 |
|
|
|
25 |
WORKDIR /app
|
26 |
|
27 |
+
# Python dependencies
|
28 |
COPY requirements.txt .
|
29 |
RUN pip install --no-cache-dir -r requirements.txt
|
30 |
|
31 |
+
# Create directories
|
32 |
+
RUN mkdir -p /app/{weights,imgs} && \
|
33 |
+
chmod -R 777 /app
|
34 |
|
35 |
+
# Application code
|
36 |
COPY main.py utils.py download_models.py ./
|
37 |
|
38 |
+
# Download models
|
39 |
+
RUN python3 download_models.py
|
40 |
|
41 |
+
# Set up user
|
42 |
RUN useradd -m -u 1000 user
|
43 |
USER user
|
44 |
ENV PATH="/home/user/.local/bin:$PATH"
|
45 |
|
|
|
46 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|