9be6bd03e3
Dashboard pemetaan statis kini dilayani aplikasi di /dashboard (app/static/dashboard.html). Fitur lengkap Tahap 1-4 + dasbor monitoring, menu global, filter semester, input nilai langsung, penggabungan nilai team teaching, tabel bisa urut. Dockerfile berubah dari nginx statis ke uvicorn/FastAPI: healthcheck, proxy-headers, volume /data (SQLite). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
26 lines
825 B
Docker
26 lines
825 B
Docker
FROM python:3.12-slim
|
|
|
|
# Opsional: aktifkan baris berikut agar tombol "PDF" berfungsi di server
|
|
# (menambah ukuran image ±700 MB):
|
|
# RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
# libreoffice-writer && rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /srv
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY app ./app
|
|
COPY seed ./seed
|
|
|
|
ENV DB_PATH=/data/app.db \
|
|
PYTHONUNBUFFERED=1
|
|
VOLUME /data
|
|
|
|
EXPOSE 8000
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s \
|
|
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/login')" || exit 1
|
|
|
|
# --proxy-headers: hormati X-Forwarded-* dari reverse proxy Coolify (Traefik)
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", \
|
|
"--proxy-headers", "--forwarded-allow-ips=*"]
|