Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -8
Dockerfile
CHANGED
|
@@ -1,25 +1,27 @@
|
|
| 1 |
-
#
|
| 2 |
FROM python:3.10-slim-bookworm
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
RUN apt-get update && apt-get install -y \
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
libopenblas-dev \
|
| 7 |
libgomp1 \
|
| 8 |
-
gcc \
|
| 9 |
-
python3-dev \
|
| 10 |
&& rm -rf /var/lib/apt/lists/*
|
| 11 |
|
| 12 |
WORKDIR /code
|
| 13 |
|
| 14 |
-
# Copy and install requirements
|
| 15 |
COPY ./requirements.txt /code/requirements.txt
|
|
|
|
|
|
|
| 16 |
RUN pip install --no-cache-dir -r /code/requirements.txt
|
| 17 |
|
| 18 |
-
# Copy the application code
|
| 19 |
COPY . .
|
| 20 |
|
| 21 |
-
# Expose the
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
# Start the server bound to 0.0.0.0 so it's reachable from the web
|
| 25 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
+
# Use Python 3.10 on Debian Bookworm
|
| 2 |
FROM python:3.10-slim-bookworm
|
| 3 |
|
| 4 |
+
# Install the COMPILERS and math libraries (Fixes your g++ error)
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
+
gcc \
|
| 7 |
+
g++ \
|
| 8 |
+
make \
|
| 9 |
+
cmake \
|
| 10 |
libopenblas-dev \
|
| 11 |
libgomp1 \
|
|
|
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
WORKDIR /code
|
| 15 |
|
| 16 |
+
# Copy and install requirements
|
| 17 |
COPY ./requirements.txt /code/requirements.txt
|
| 18 |
+
|
| 19 |
+
# We force pip to look for the pre-built CPU wheel first
|
| 20 |
RUN pip install --no-cache-dir -r /code/requirements.txt
|
| 21 |
|
|
|
|
| 22 |
COPY . .
|
| 23 |
|
| 24 |
+
# Expose the port for Hugging Face
|
| 25 |
EXPOSE 7860
|
| 26 |
|
|
|
|
| 27 |
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|