| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Keeps logs instant and prevents Docker from writing unnecessary .pyc files | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 | |
| # Installs timezone data cleanly so the scheduler doesn't break | |
| RUN apt-get update && \ | |
| apt-get install -y tzdata && \ | |
| ln -fs /usr/share/zoneinfo/UTC /etc/localtime && \ | |
| dpkg-reconfigure -f noninteractive tzdata && \ | |
| rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| # Upgrades pip and installs everything using pre-compiled binaries for maximum speed | |
| RUN pip install --upgrade pip && \ | |
| pip install --no-cache-dir --prefer-binary -r requirements.txt | |
| COPY . . | |
| # Boots the app | |
| CMD ["python", "app.py"] |