Skip to content

Commit

Permalink
Health Check (ThePornDatabase#244)
Browse files Browse the repository at this point in the history
* add curl and healthcheck

* update dependencies
  • Loading branch information
DirtyRacer1337 authored Mar 22, 2024
1 parent 846aeb5 commit a1e3380
Show file tree
Hide file tree
Showing 6 changed files with 1,386 additions and 1,328 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.7.0'
poetry-version: '1.8.2'

- name: Install Go
uses: actions/setup-go@v5
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.7.0'
poetry-version: '1.8.2'

- uses: pnpm/action-setup@v3
with:
Expand Down Expand Up @@ -166,7 +166,7 @@ jobs:
- name: install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.7.0'
poetry-version: '1.8.2'

- name: create tag from pyproject version on change.
id: auto-tag
Expand Down Expand Up @@ -211,7 +211,7 @@ jobs:
- name: Install poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: '1.7.0'
poetry-version: '1.8.2'

- name: Install Go
uses: actions/setup-go@v5
Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ RUN apt-get update \
python3 \
ffmpeg \
tzdata \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& rm -Rf /usr/share/doc && rm -Rf /usr/share/man \
&& apt-get clean
Expand Down Expand Up @@ -78,4 +79,5 @@ ENV BUILD_DATE=$BUILD_DATE
ENV GIT_HASH=$GIT_HASH
ENV PROJECT_VERSION=$PROJECT_VERSION
EXPOSE 6980
HEALTHCHECK --interval=1m --timeout=30s CMD curl -f http://localhost:6980/api/healthcheck || exit 1
ENTRYPOINT ["python3", "-m", "namer", "watchdog"]
9 changes: 9 additions & 0 deletions namer/web/routes/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,4 +119,13 @@ def read_failed_log() -> Response:

return jsonify(res)

@blueprint.route('/healthcheck', methods=['GET'])
def healthcheck() -> Response:
# fmt: off
res = {
'status': 'OK',
}

return jsonify(res)

return blueprint
24 changes: 12 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@
"@popperjs/core": "^2.11.8",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"datatables.net": "^2.0.1",
"datatables.net-bs5": "^2.0.1",
"datatables.net-buttons": "^3.0.0",
"datatables.net-buttons-bs5": "^3.0.0",
"datatables.net": "^2.0.2",
"datatables.net-bs5": "^2.0.2",
"datatables.net-buttons": "^3.0.1",
"datatables.net-buttons-bs5": "^3.0.1",
"datatables.net-colreorder": "^2.0.0",
"datatables.net-colreorder-bs5": "^2.0.0",
"datatables.net-fixedheader": "^4.0.0",
"datatables.net-fixedheader-bs5": "^4.0.0",
"datatables.net-fixedheader": "^4.0.1",
"datatables.net-fixedheader-bs5": "^4.0.1",
"datatables.net-responsive": "^3.0.0",
"datatables.net-responsive-bs5": "^3.0.0",
"jquery": "^3.7.1",
"lodash": "^4.17.21"
},
"devDependencies": {
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/core": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"babel-loader": "^9.1.3",
"copy-webpack-plugin": "^11.0.0",
"css-loader": "^6.10.0",
Expand All @@ -45,13 +45,13 @@
"husky": "^8.0.3",
"lint-staged": "^14.0.1",
"mini-css-extract-plugin": "^2.8.1",
"postcss": "^8.4.35",
"postcss": "^8.4.38",
"postcss-loader": "^7.3.4",
"postcss-preset-env": "^9.4.0",
"sass": "^1.71.1",
"postcss-preset-env": "^9.5.2",
"sass": "^1.72.0",
"sass-loader": "^13.3.3",
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.90.3",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4"
}
}
Loading

0 comments on commit a1e3380

Please sign in to comment.