Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +16 -1
Dockerfile
CHANGED
|
@@ -1,11 +1,26 @@
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /code
|
| 4 |
|
|
|
|
| 5 |
COPY ./requirements.txt /code/requirements.txt
|
| 6 |
|
|
|
|
| 7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 8 |
|
|
|
|
| 9 |
COPY . .
|
| 10 |
|
| 11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
FROM python:3.9
|
| 2 |
|
| 3 |
+
# Set up environment variables
|
| 4 |
+
ENV TRANSFORMERS_CACHE=/cache/huggingface/hub
|
| 5 |
+
|
| 6 |
+
# Create cache directory and set permissions
|
| 7 |
+
RUN mkdir -p /cache/huggingface/hub && \
|
| 8 |
+
chmod -R 777 /cache
|
| 9 |
+
|
| 10 |
+
# Set working directory
|
| 11 |
WORKDIR /code
|
| 12 |
|
| 13 |
+
# Copy requirements file
|
| 14 |
COPY ./requirements.txt /code/requirements.txt
|
| 15 |
|
| 16 |
+
# Install dependencies
|
| 17 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 18 |
|
| 19 |
+
# Copy application code
|
| 20 |
COPY . .
|
| 21 |
|
| 22 |
+
# Expose port
|
| 23 |
+
EXPOSE 7860
|
| 24 |
+
|
| 25 |
+
# Command to run the application
|
| 26 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|