mirror of
https://github.com/LibreTranslate/LibreTranslate.git
synced 2026-03-04 08:00:00 -05:00
Implement Docker health check in CI workflow
Added a health check step for the Docker container in the CI workflow.
This commit is contained in:
parent
296e53e511
commit
3ef4361852
18
.github/workflows/run-tests.yml
vendored
18
.github/workflows/run-tests.yml
vendored
@ -48,3 +48,21 @@ jobs:
|
||||
|
||||
- name: Docker build with some models
|
||||
run: docker build -f docker/Dockerfile -t libretranslate --build-arg models=en,es .
|
||||
|
||||
test_docker_healthcheck:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Docker compose up
|
||||
run: LT_LOAD_ONLY=en,fr docker compose up -d
|
||||
|
||||
- name: Check Healthcheck
|
||||
run: |
|
||||
for i in {1..60}; do
|
||||
STATUS=$(docker inspect -f '{{ .State.Health.Status }}' libretranslate 2>/dev/null || echo 'no')
|
||||
echo "Status: $STATUS"
|
||||
if [ "$STATUS" = "healthy" ]; then exit 0; fi
|
||||
sleep 2
|
||||
done
|
||||
echo "LibreTranslate did not become healthy"
|
||||
exit 1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user