-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 919 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 919 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
FROM python:3.10-slim
WORKDIR /app
# System dependencies for PyMuPDF (PDF parsing)
RUN apt-get update && apt-get install -y --no-install-recommends \
libmupdf-dev \
libfreetype6-dev \
libharfbuzz-dev \
libjpeg-dev \
libopenjp2-7-dev \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies (requirements.txt is at project root)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code from biobot/ into /app/
COPY biobot/ .
RUN mkdir -p /app/data
# Flask environment
ENV FLASK_APP=app.py
ENV FLASK_RUN_HOST=0.0.0.0
ENV FLASK_ENV=development
# Force Python to flush stdout/stderr immediately
ENV PYTHONUNBUFFERED=1
# Run Flask directly
#CMD ["python", "-u", "app.py"]
#CMD ["sh", "-c", "python init_db.py && python -u app.py"]
# Production server
CMD ["sh", "-c", "python init_db.py && gunicorn -w 4 -b 0.0.0.0:5000 --timeout 600 app:app"]