Spaces:
Sleeping
Sleeping
Commit ·
41146f6
1
Parent(s): c65ea29
Fixing things again
Browse files- Dockerfile +7 -8
Dockerfile
CHANGED
|
@@ -18,10 +18,9 @@ ENV TRANSFORMERS_CACHE=/.cache/huggingface/transformers
|
|
| 18 |
COPY requirements-docker.txt ./requirements.txt
|
| 19 |
|
| 20 |
# Install Python dependencies (optimized for Docker)
|
|
|
|
| 21 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 22 |
-
pip install --no-cache-dir -r requirements.txt
|
| 23 |
-
pip install --no-cache-dir fastapi uvicorn pydantic && \
|
| 24 |
-
python -m spacy download en_core_web_sm
|
| 25 |
|
| 26 |
# Copy the rest of the application
|
| 27 |
COPY . .
|
|
@@ -38,11 +37,11 @@ RUN chown -R user:user /code
|
|
| 38 |
|
| 39 |
USER user
|
| 40 |
|
| 41 |
-
# Expose the port
|
| 42 |
EXPOSE 7860
|
| 43 |
|
| 44 |
-
# Health check
|
| 45 |
-
HEALTHCHECK CMD curl --fail http://localhost:7860/
|
| 46 |
|
| 47 |
-
# Run the FastAPI server (which also starts Streamlit)
|
| 48 |
-
|
|
|
|
| 18 |
COPY requirements-docker.txt ./requirements.txt
|
| 19 |
|
| 20 |
# Install Python dependencies (optimized for Docker)
|
| 21 |
+
# Note: FastAPI, uvicorn, pydantic already in requirements-docker.txt
|
| 22 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 23 |
+
pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# Copy the rest of the application
|
| 26 |
COPY . .
|
|
|
|
| 37 |
|
| 38 |
USER user
|
| 39 |
|
| 40 |
+
# Expose the port FastAPI runs on
|
| 41 |
EXPOSE 7860
|
| 42 |
|
| 43 |
+
# Health check for FastAPI
|
| 44 |
+
HEALTHCHECK CMD curl --fail http://localhost:7860/health || exit 1
|
| 45 |
|
| 46 |
+
# Run the FastAPI server (which also starts Streamlit in background)
|
| 47 |
+
CMD ["python", "api_server.py"]
|