-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (28 loc) · 984 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (28 loc) · 984 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
# Use a small Python base image suitable for production
FROM python:3.11-slim
# Prevent Python from writing .pyc files and enable unbuffered logs
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PORT=5000 \
FLASK_DEBUG=0
# Set work directory
WORKDIR /app
# Install system dependencies (kept minimal for slim image) and Python requirements
COPY requirements.txt ./
RUN apt-get update \
&& apt-get install -y --no-install-recommends build-essential \
&& rm -rf /var/lib/apt/lists/* \
&& pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# Copy application code, configuration, frontend, and model artifacts
COPY backend ./backend
COPY training ./training
COPY frontend ./frontend
COPY configs ./configs
COPY models ./models
COPY data ./data
COPY README.md ./
# Expose the Flask port
EXPOSE 5000
# Default command to run the Flask inference service with Gunicorn
CMD ["gunicorn", "-b", "0.0.0.0:5000", "backend.app:app"]