Update Dockerfile
Browse files- Dockerfile +0 -22
Dockerfile
CHANGED
|
@@ -1,32 +1,10 @@
|
|
| 1 |
-
# Use TensorFlow GPU image
|
| 2 |
FROM tensorflow/tensorflow:2.10.0-gpu
|
| 3 |
|
| 4 |
-
# ✅ Manually install TensorFlow CPU version
|
| 5 |
-
RUN pip install --no-cache-dir tensorflow==2.10.0
|
| 6 |
-
|
| 7 |
-
# Set working directory
|
| 8 |
WORKDIR /app
|
| 9 |
|
| 10 |
-
# Ensure /tmp is writable
|
| 11 |
-
RUN chmod -R 777 /tmp
|
| 12 |
-
|
| 13 |
-
# Copy requirements and install
|
| 14 |
COPY requirements.txt .
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
# Download the model during the build process
|
| 18 |
-
RUN mkdir -p /app/model && \
|
| 19 |
-
python3 -c "from huggingface_hub import hf_hub_download; \
|
| 20 |
-
hf_hub_download(repo_id='Miguel764/efficientnetv2s-skin-cancer-classifier', \
|
| 21 |
-
filename='efficientnetv2s.h5', local_dir='/app/model')"
|
| 22 |
-
|
| 23 |
COPY app/ ./app/
|
| 24 |
|
| 25 |
-
# Ensure app directory is readable
|
| 26 |
-
RUN chmod -R 755 /app
|
| 27 |
-
|
| 28 |
-
# Expose port (Hugging Face Spaces expects 7860)
|
| 29 |
-
EXPOSE 7860
|
| 30 |
-
|
| 31 |
-
# Run FastAPI app
|
| 32 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
|
|
|
| 1 |
FROM tensorflow/tensorflow:2.10.0-gpu
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
WORKDIR /app
|
| 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
COPY requirements.txt .
|
| 6 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
COPY app/ ./app/
|
| 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]
|