# MCLogger Web Panel
FROM python:3.11-slim

WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends curl \
    && rm -rf /var/lib/apt/lists/*

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

EXPOSE 5000

# ── Statische Umgebungsvariablen (nur build-time defaults) ────────────────────
ENV PYTHONUNBUFFERED=1
ENV FLASK_APP=app.py
# Alle anderen ENV (DB, Passwörter, Keys) werden von Coolify zur Laufzeit gesetzt

# Non-root user
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
USER appuser

CMD ["gunicorn", "--bind", "0.0.0.0:5000", "--workers", "2", "--timeout", "60", "app:app"]

