feat: add container restart storage test

This commit is contained in:
2026-08-06 11:05:00 +08:00
commit 30de0d61ef
4 changed files with 108 additions and 0 deletions

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM python:3.10-slim
WORKDIR /app
COPY test_restart.py /app/test_restart.py
ENV PORT=8080
ENV RUN_SECONDS=60
EXPOSE 8080
HEALTHCHECK --interval=10s --timeout=3s --start-period=3s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8080/health', timeout=2)" || exit 1
CMD ["python", "/app/test_restart.py"]