Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -10
Dockerfile
CHANGED
@@ -1,18 +1,21 @@
|
|
1 |
-
FROM
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
-
RUN apt-get update &&
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
transformers fastapi uvicorn accelerate bitsandbytes
|
10 |
|
11 |
-
COPY app.py
|
12 |
-
COPY requirements.txt /app/requirements.txt
|
13 |
|
14 |
-
|
|
|
15 |
|
16 |
-
|
|
|
17 |
|
18 |
-
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "
|
|
|
1 |
+
FROM python:3.10-slim
|
2 |
|
3 |
WORKDIR /app
|
4 |
|
5 |
+
RUN apt-get update && \
|
6 |
+
apt-get install -y --no-install-recommends \
|
7 |
+
build-essential \
|
8 |
+
&& rm -rf /var/lib/apt/lists/*
|
9 |
|
10 |
+
COPY requirements.txt .
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
12 |
|
13 |
+
COPY app.py .
|
|
|
14 |
|
15 |
+
RUN mkdir -p /tmp/transformers_cache && \
|
16 |
+
chmod 777 /tmp/transformers_cache
|
17 |
|
18 |
+
RUN useradd -m appuser
|
19 |
+
USER appuser
|
20 |
|
21 |
+
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|