All checks were successful
Deploy / deploy (push) Successful in 17s
Python urllib GET / on 127.0.0.1:8000. start_period=30s gives gunicorn workers time to boot. Lets Docker mark container unhealthy if Flask app wedges, and feeds Portainer + diagnose.sh signal that the app is alive. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
18 lines
461 B
Docker
18 lines
461 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY app.py .
|
|
COPY templates/ templates/
|
|
|
|
ENV PYTHONUNBUFFERED=1
|
|
EXPOSE 8000
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --retries=3 --start-period=30s \
|
|
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/').close()" || exit 1
|
|
|
|
CMD ["gunicorn", "-b", "0.0.0.0:8000", "-w", "2", "--access-logfile", "-", "app:app"]
|