fraud_detection_api_1 / Dockerfile
cindyy287's picture
Update Dockerfile
5085c46 verified
raw
history blame contribute delete
540 Bytes
FROM python:3.11-slim
# Environment safety
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Workdir
WORKDIR /app
# System deps (minimal)
RUN apt-get update && apt-get install -y \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first (cache friendly)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy app code
COPY . .
# Expose port
EXPOSE 5001
# Run with gunicorn (PRODUCTION)
# CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:5001", "app:app"]
CMD ["python", "app.py"]