Spaces:
Sleeping
Sleeping
Commit
·
6c0a4b3
1
Parent(s):
115dbf9
added some echo files in dockerfile
Browse files- Dockerfile +7 -2
Dockerfile
CHANGED
|
@@ -2,7 +2,6 @@ FROM python:3.11-slim
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
| 5 |
-
ENV TRANSFORMERS_CACHE /app/.cache/huggingface/hub
|
| 6 |
|
| 7 |
COPY requirements.txt /app/requirements.txt
|
| 8 |
|
|
@@ -10,6 +9,12 @@ RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
|
| 10 |
|
| 11 |
COPY . /app
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
EXPOSE 7860
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
| 2 |
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
| 5 |
|
| 6 |
COPY requirements.txt /app/requirements.txt
|
| 7 |
|
|
|
|
| 9 |
|
| 10 |
COPY . /app
|
| 11 |
|
| 12 |
+
# Create a script to set up the directory and environment variable
|
| 13 |
+
RUN echo "mkdir -p /app/.cache" > setup.sh && \
|
| 14 |
+
echo "export TRANSFORMERS_CACHE=/app/.cache" >> setup.sh && \
|
| 15 |
+
chmod +x setup.sh
|
| 16 |
+
|
| 17 |
EXPOSE 7860
|
| 18 |
|
| 19 |
+
# Run the script as part of the CMD
|
| 20 |
+
CMD ["./setup.sh", "&&", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|