File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -35,14 +35,15 @@ ENV PORT=3000 \
3535
3636EXPOSE $PORT
3737
38- HEALTHCHECK --interval=30m --timeout=60s --start-period=5s \
39- CMD curl -f http://${HEALTH_CHECK_USERNAME}:${HEALTH_CHECK_PASSWORD}@ localhost:${PORT}/health_check.txt || exit 1
38+ HEALTHCHECK --interval=60s --timeout=15s --start-period=5s \
39+ CMD curl -f http://localhost:${PORT}/health_check.txt || exit 1
4040
4141ARG USER=html2rss
4242ARG UID=991
4343ARG GID=991
4444
4545RUN apk add --no-cache \
46+ 'curl>=8' \
4647 'gcompat>=0' \
4748 'tzdata>=2024' \
4849 'libxml2>=2' \
Original file line number Diff line number Diff line change @@ -62,6 +62,22 @@ task :test do
6262
6363 Output . describe 'Print output of `html2rss help`'
6464 sh 'docker exec html2rss-web-test html2rss help'
65+
66+ Output . describe 'Expect health status to be healthy'
67+ health_status = nil
68+ 10 . times do
69+ health_status = `docker inspect --format='{{.State.Health.Status}}' html2rss-web-test` . strip
70+
71+ if health_status == 'healthy'
72+ puts '✅ Health status reports `healthy`'
73+ break
74+ else
75+ putc '.'
76+ sleep 3
77+ end
78+ end
79+
80+ raise "❌ Health status reports `#{ health_status } `" if health_status != 'healthy'
6581ensure
6682 test_container_exists = JSON . parse ( `docker inspect html2rss-web-test` ) . any?
6783
7288 sh 'docker stop html2rss-web-test'
7389 sh 'docker rm html2rss-web-test'
7490 end
91+
92+ exit 1 if $ERROR_INFO
7593end
You can’t perform that action at this time.
0 commit comments