Skip to content

Commit a86976f

Browse files
authored
Add smoke test for Docker container sanity (#205)
And fix the failure we just introduced in the last patch
1 parent fb17c1d commit a86976f

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/build-docker.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,20 @@ jobs:
3737
file: docker/lnt.dockerfile
3838
# Use the current directory as context, as checked out by actions/checkout -- needed for setuptools_scm
3939
context: .
40+
41+
- name: Smoke test - start server and ping it
42+
run: |
43+
docker compose -f docker/compose.yaml up --build --detach
44+
timeout 120 bash -c 'until curl -sf http://localhost:8000; do sleep 2; done'
45+
curl -f http://localhost:8000
46+
env:
47+
LNT_DB_PASSWORD: smoke-test-password
48+
LNT_AUTH_TOKEN: smoke-test-token
49+
50+
- name: Dump logs on failure
51+
if: failure()
52+
run: docker compose -f docker/compose.yaml logs
53+
54+
- name: Teardown
55+
if: always()
56+
run: docker compose -f docker/compose.yaml down

docker/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ services:
5656
volumes:
5757
- instance:/var/lib/lnt
5858
ports:
59-
- "8000"
59+
- "8000:8000"
6060
networks:
6161
- lnt_network
6262

0 commit comments

Comments
 (0)