-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdockerfile
More file actions
31 lines (22 loc) · 797 Bytes
/
dockerfile
File metadata and controls
31 lines (22 loc) · 797 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
# Base image that matches your local Python exactly
FROM python:3.10.11-slim
# Prevents Python from writing .pyc files & enables clean logs
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# System dependencies for scientific libraries
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Working directory inside container
WORKDIR /app
# Copy only requirements first (better caching)
COPY requirements.txt .
# Upgrade pip and install dependencies
RUN pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# Copy full project
COPY . .
# Expose Flask port
EXPOSE 5000
# Start server with Gunicorn (production-ready)
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:5000", "--workers", "1", "--timeout", "120"]