Jack
commited on
Commit
·
2abdff1
1
Parent(s):
54ffdc7
edited dockerfile
Browse files- Dockerfile +0 -8
Dockerfile
CHANGED
|
@@ -1,24 +1,16 @@
|
|
| 1 |
-
# Use Python 3.10 as the base image
|
| 2 |
FROM python:3.10
|
| 3 |
|
| 4 |
-
# Set the working directory in the container
|
| 5 |
WORKDIR /code
|
| 6 |
|
| 7 |
-
# Copy the current directory contents into the container with correct ownership
|
| 8 |
COPY --link --chown=1000 . .
|
| 9 |
|
| 10 |
-
# Create a cache directory for Hugging Face Hub and set permissions
|
| 11 |
RUN mkdir -p /tmp/cache/
|
| 12 |
RUN chmod a+rwx -R /tmp/cache/
|
| 13 |
|
| 14 |
-
# Set Hugging Face Hub cache directory environment variable
|
| 15 |
ENV HF_HUB_CACHE=HF_HOME
|
| 16 |
|
| 17 |
-
# Install any needed packages specified in requirements.txt
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
|
| 20 |
-
# Set environment variables
|
| 21 |
ENV PYTHONUNBUFFERED=1 PORT=7860
|
| 22 |
|
| 23 |
-
# Run the FastAPI app using Uvicorn
|
| 24 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
| 1 |
FROM python:3.10
|
| 2 |
|
|
|
|
| 3 |
WORKDIR /code
|
| 4 |
|
|
|
|
| 5 |
COPY --link --chown=1000 . .
|
| 6 |
|
|
|
|
| 7 |
RUN mkdir -p /tmp/cache/
|
| 8 |
RUN chmod a+rwx -R /tmp/cache/
|
| 9 |
|
|
|
|
| 10 |
ENV HF_HUB_CACHE=HF_HOME
|
| 11 |
|
|
|
|
| 12 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 13 |
|
|
|
|
| 14 |
ENV PYTHONUNBUFFERED=1 PORT=7860
|
| 15 |
|
|
|
|
| 16 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|