-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 839 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 839 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
# Dockerfile
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first to leverage Docker layer caching
COPY ./app/requirements.txt /app/requirements.txt
# Upgrade pip and install numpy first with a compatible version
RUN pip install --upgrade pip
RUN pip install "numpy>=1.21.0,<1.25.0" # Use a version compatible with your pandas
# Now install the rest of the requirements
RUN pip install --no-cache-dir -r /app/requirements.txt
# Copy application source
COPY ./app /app
# Expose a port
EXPOSE 8080
# Run your app
CMD ["gunicorn", "main:app", "--bind", "0.0.0.0:8080", "--workers", "3", "--timeout", "120"]