Spaces:
Sleeping
Sleeping
Upload Dockerfile
Browse files- Dockerfile +32 -0
Dockerfile
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Stage 1: Build stage (installs docker)
|
2 |
+
FROM python:3.9.13 AS builder
|
3 |
+
|
4 |
+
RUN apt-get update && apt-get install -y docker-ce
|
5 |
+
|
6 |
+
# Clear build cache
|
7 |
+
RUN docker builder prune -f
|
8 |
+
|
9 |
+
FROM python:3.9.13
|
10 |
+
|
11 |
+
USER root
|
12 |
+
RUN apt-get update && \
|
13 |
+
apt-get install -y libgl1-mesa-glx ffmpeg
|
14 |
+
|
15 |
+
RUN useradd -m -u 1000 user
|
16 |
+
USER user
|
17 |
+
ENV HOME=/home/user \
|
18 |
+
PATH=/home/user/.local/bin:$PATH
|
19 |
+
|
20 |
+
WORKDIR $HOME/app
|
21 |
+
|
22 |
+
COPY --chown=user . $HOME/app
|
23 |
+
|
24 |
+
RUN chmod +x scripts/download_models.sh
|
25 |
+
RUN bash scripts/download_models.sh
|
26 |
+
ENV NUMBA_CACHE_DIR=/tmp/numba_cache
|
27 |
+
RUN pip install -r requirements.txt
|
28 |
+
|
29 |
+
# CMD ["gunicorn", "-b", "0.0.0.0:7860","app:app"]
|
30 |
+
CMD ["gunicorn", "-b", "0.0.0.0:7860", "--timeout", "180", "app:app"]
|
31 |
+
|
32 |
+
#CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|