FROM python:3.12-slim RUN useradd --create-home --shell /bin/bash appuser WORKDIR /app COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY app/ ./app/ RUN mkdir -p /app/data && chown -R appuser:appuser /app USER appuser ENV PYTHONUNBUFFERED=1 EXPOSE 8090 CMD ["python", "-m", "app.main"]