Skip to content

Commit 9aaaf4d

Browse files
authored
Merge branch 'master' into feat/optional-columns
2 parents 4eebc65 + af7b674 commit 9aaaf4d

File tree

3 files changed

+45
-6
lines changed

3 files changed

+45
-6
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,40 @@ jobs:
3232
- uses: actionsx/prettier@v2
3333
with:
3434
args: --check "{src,test}/**/*.ts"
35+
36+
docker:
37+
name: Build with docker
38+
runs-on: ubuntu-20.04
39+
steps:
40+
- uses: actions/checkout@v3
41+
name: Checkout Repo
42+
43+
- uses: docker/setup-buildx-action@v2
44+
name: Set up Docker Buildx
45+
46+
- uses: docker/build-push-action@v3
47+
with:
48+
push: false
49+
tags: pg-meta:test
50+
load: true
51+
cache-from: type=gha
52+
cache-to: type=gha,mode=max
53+
54+
- name: Check Health status
55+
run: |
56+
docker run -d --name pg-meta-test pg-meta:test
57+
state=$(docker inspect -f '{{ .State.Health.Status}}' pg-meta-test)
58+
if [ $state != "starting" ]; then
59+
exit 1
60+
fi
61+
sleep 10
62+
state=$(docker inspect -f '{{ .State.Health.Status}}' pg-meta-test)
63+
docker stop pg-meta-test
64+
if [ $state == "healthy" ]; then
65+
exit 0
66+
else
67+
exit 1
68+
fi
69+
70+
71+

Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,5 @@ COPY package.json ./
1515
ENV PG_META_PORT=8080
1616
CMD ["npm", "run", "start"]
1717
EXPOSE 8080
18+
# --start-period defaults to 0s, but can't be set to 0s (to be explicit) by now
19+
HEALTHCHECK --interval=5s --timeout=5s --retries=3 CMD node -e "require('http').get('http://localhost:8080/health', (r) => {if (r.statusCode !== 200) throw new Error(r.statusCode)})"

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)