Spaces:
Runtime error
Runtime error
Remove ngrok completely - simplify deployment to just FastAPI
Browse files- Dockerfile +6 -17
Dockerfile
CHANGED
@@ -3,7 +3,7 @@ FROM python:3.10-slim
|
|
3 |
|
4 |
# System dependencies for OCR and PDF processing
|
5 |
RUN apt-get update && \
|
6 |
-
apt-get install -y tesseract-ocr poppler-utils
|
7 |
rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
# Set workdir
|
@@ -17,22 +17,11 @@ RUN mkdir -p ./uploaded_docs
|
|
17 |
# Install Python dependencies
|
18 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
19 |
|
20 |
-
#
|
21 |
-
|
22 |
|
23 |
-
#
|
24 |
-
EXPOSE 8000 4040
|
25 |
-
|
26 |
-
# Copy entrypoint script
|
27 |
-
COPY --from=busybox:latest /bin/sh /bin/sh
|
28 |
-
COPY --from=busybox:latest /bin/sleep /bin/sleep
|
29 |
-
|
30 |
-
# Entrypoint script to start both FastAPI and ngrok
|
31 |
-
COPY docker-entrypoint.sh /docker-entrypoint.sh
|
32 |
-
RUN chmod +x /docker-entrypoint.sh
|
33 |
-
|
34 |
-
# Set environment variables (ngrok authtoken and Mistral API key can be set at runtime)
|
35 |
-
ENV NGROK_AUTHTOKEN=""
|
36 |
ENV MISTRAL_API_KEY=""
|
37 |
|
38 |
-
|
|
|
|
3 |
|
4 |
# System dependencies for OCR and PDF processing
|
5 |
RUN apt-get update && \
|
6 |
+
apt-get install -y tesseract-ocr poppler-utils libgl1 libglib2.0-0 && \
|
7 |
rm -rf /var/lib/apt/lists/*
|
8 |
|
9 |
# Set workdir
|
|
|
17 |
# Install Python dependencies
|
18 |
RUN pip install --upgrade pip && pip install -r requirements.txt
|
19 |
|
20 |
+
# Expose FastAPI port
|
21 |
+
EXPOSE 8000
|
22 |
|
23 |
+
# Set environment variables
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
ENV MISTRAL_API_KEY=""
|
25 |
|
26 |
+
# Start FastAPI application
|
27 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|