Skip to content

Commit

Permalink
build(dockerfile): move healthcheck to docker-compose (#253)
Browse files Browse the repository at this point in the history
* build(dockerfile): move `healthcheck` to `docker-compose`
* chore(deps): update dependencies
  • Loading branch information
DeadNews authored Aug 18, 2024
1 parent c1e6b73 commit 2f19075
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 15 deletions.
45 changes: 45 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,50 @@
# Changelog

## [2.0.9-alpha.0](https:/DeadNews/deadnews-template-python/compare/v2.0.8...v2.0.9-alpha.0) - 2024-08-18

### 🐛 Bug fixes

- _(build)_ drop `pypy` support ([#252](https:/DeadNews/deadnews-template-python/issues/252)) - ([ee9dbf9](https:/DeadNews/deadnews-template-python/commit/ee9dbf9518670bd5cdc79df013d6cf435fe99bea))

### 📚 Documentation

- _(changelog)_ update git-cliff config - ([4c53c02](https:/DeadNews/deadnews-template-python/commit/4c53c0218ec044e16086ef4a14c84cf66e7f29af))

### 🧹 Chores

- _(dockerfile)_ update `healthcheck` command - ([b00bec2](https:/DeadNews/deadnews-template-python/commit/b00bec23d8307595ab06eafb56d8be638c34c41c))
- _(typos)_ ignore short words - ([55b6288](https:/DeadNews/deadnews-template-python/commit/55b62888dfac39ed89b8acdfe308120cf6975e6d))

### 👷 Build

- _(dockerfile)_ move `healthcheck` to `docker-compose` - ([bd90180](https:/DeadNews/deadnews-template-python/commit/bd90180d064d28c03a5bfd37e25e22fca1471d76))
- _(dockerfile)_ move `healthcheck` to `docker-compose` - ([9d72a8d](https:/DeadNews/deadnews-template-python/commit/9d72a8dfc566cf63c785c6a92aa676c9abb65449))

### ⚙️ CI/CD

- _(github)_ update `deadnews-template-docker` to `main` branch - ([48f62a1](https:/DeadNews/deadnews-template-python/commit/48f62a1fe88436c115cfbbb557b19ca18aa11c55))
- _(github)_ try explicit os versions - ([27a3a93](https:/DeadNews/deadnews-template-python/commit/27a3a93f714cf3fd8d724b202e3cd0cdec29a0d2))

### ⬆️ Dependencies

- _(deps)_ update dependency fastapi to ^0.112.0 ([#248](https:/DeadNews/deadnews-template-python/issues/248)) - ([62ed242](https:/DeadNews/deadnews-template-python/commit/62ed242eb425112eee102701b77784971a0128bb))
- _(deps)_ update dependency uvicorn to v0.30.5 ([#247](https:/DeadNews/deadnews-template-python/issues/247)) - ([ffd546e](https:/DeadNews/deadnews-template-python/commit/ffd546ec9a909d673d552f8d5678a46d01f6162a))
- _(deps)_ update dependency uvicorn to v0.30.3 ([#239](https:/DeadNews/deadnews-template-python/issues/239)) - ([bae15f8](https:/DeadNews/deadnews-template-python/commit/bae15f8b17a255328cd778488fa11ad235057af1))
- _(deps)_ update dependency fastapi to ^0.111.0 ([#217](https:/DeadNews/deadnews-template-python/issues/217)) - ([d4ef27a](https:/DeadNews/deadnews-template-python/commit/d4ef27a6a14b60b9e15c11b4c9659a173b5b0358))
- _(deps)_ update dependency pydantic to v2.8.2 ([#237](https:/DeadNews/deadnews-template-python/issues/237)) - ([7317847](https:/DeadNews/deadnews-template-python/commit/7317847c686081d5ab9ddc2fef3faa9d3cf07718))
- _(deps)_ update dependency pydantic to v2.7.4 ([#229](https:/DeadNews/deadnews-template-python/issues/229)) - ([2806a39](https:/DeadNews/deadnews-template-python/commit/2806a39334eaf446b1c6bdb32083050fcbebec0e))
- _(deps)_ update dependency uvicorn to v0.30.1 ([#228](https:/DeadNews/deadnews-template-python/issues/228)) - ([bf9d55c](https:/DeadNews/deadnews-template-python/commit/bf9d55c0dae2eb2ca002a288dffe5dced04e7a86))
- _(deps)_ update dependency pydantic to v2.7.3 ([#227](https:/DeadNews/deadnews-template-python/issues/227)) - ([957ea82](https:/DeadNews/deadnews-template-python/commit/957ea824ffe77598eb95c185cd61f041190fdc67))
- _(deps)_ update dependency pydantic to v2.7.2 ([#226](https:/DeadNews/deadnews-template-python/issues/226)) - ([b47106f](https:/DeadNews/deadnews-template-python/commit/b47106f701a749bda84f1691243ae21bb854fc66))
- _(deps)_ update dependency uvicorn to ^0.30.0 ([#223](https:/DeadNews/deadnews-template-python/issues/223)) - ([27eb4d3](https:/DeadNews/deadnews-template-python/commit/27eb4d3782392d7a61e608bd0ef244163a548d07))
- _(deps)_ update dependency pydantic to v2.7.1 ([#213](https:/DeadNews/deadnews-template-python/issues/213)) - ([8aba09c](https:/DeadNews/deadnews-template-python/commit/8aba09c46beb1d33c29163cc9acd9a21a33a8625))
- _(deps)_ update dependency fastapi to v0.110.2 ([#211](https:/DeadNews/deadnews-template-python/issues/211)) - ([c0de163](https:/DeadNews/deadnews-template-python/commit/c0de163ebb64ae398a78c610c5998e70139f68c4))
- _(deps)_ update dependency pydantic to v2.7.0 ([#209](https:/DeadNews/deadnews-template-python/issues/209)) - ([0855371](https:/DeadNews/deadnews-template-python/commit/0855371751b2416bd2cd74b28242cb268153f64f))

### ◀️ Revert

- 'ci(github): try explicit os versions' - ([809d65f](https:/DeadNews/deadnews-template-python/commit/809d65f9309a2c125040962f0f3e397c3120977a))

## [2.0.8](https:/DeadNews/deadnews-template-python/compare/v2.0.7...v2.0.8) - 2024-04-08

### 📚 Documentation
Expand Down
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ RUN pip install /app/*.whl

USER guest:users
EXPOSE ${UVICORN_PORT}
HEALTHCHECK --interval=1m --retries=3 --timeout=10s --start-period=1m \
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${UVICORN_PORT}/health || exit 1
HEALTHCHECK NONE

CMD [ "python", "-m", "uvicorn", "deadnews_template_python:app" ]
3 changes: 1 addition & 2 deletions Dockerfile.pypy
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ RUN pip install /app/*.whl

USER nobody:nogroup
EXPOSE ${UVICORN_PORT}
HEALTHCHECK --interval=1m --retries=3 --timeout=10s --start-period=1m \
CMD wget --no-verbose --tries=1 --spider http://127.0.0.1:${UVICORN_PORT}/health || exit 1
HEALTHCHECK NONE

CMD [ "python", "-m", "uvicorn", "deadnews_template_python:app" ]
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ update:
poetry up --latest

checks: pc install lint test

pc:
pre-commit run -a

lint:
poetry run poe lint

test:
poetry run poe test

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,4 @@ Docker

```sh
docker pull ghcr.io/deadnews/deadnews-template-python:latest
# or
docker pull ghcr.io/deadnews/deadnews-template-python:latest-pypy
```
12 changes: 9 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
services:
web:
service:
build: .
healthcheck:
test: wget --no-verbose --tries=1 --spider http://127.0.0.1:8000/health || exit 1
interval: 1m
retries: 3
timeout: 10s
start_period: 1m
ports:
- 127.0.0.1:${UVICORN_PORT:-8080}:${UVICORN_PORT:-8080}
- 127.0.0.1:8000:8000
environment:
UVICORN_PORT: ${UVICORN_PORT:-8080}
- WEB_CONCURRENCY=1
2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ deadnews-template-python = "deadnews_template_python.__main__:main"
python = "^3.10"
fastapi = { version = "^0.112.1", extras = ["all"] }
pydantic = "^2.8.2"
uvicorn = { version = "^0.30.0", extras = ["standard"] }
uvicorn = "^0.30.1"

[tool.poetry.group.lint.dependencies]
mypy = "^1.11.1"
Expand All @@ -33,7 +33,6 @@ ruff = "^0.6.0"
[tool.poetry.group.test.dependencies]
pytest = "^8.3.2"
pytest-cov = "^5.0.0"
httpx = "^0.27.0"

[tool.poetry.group.docs.dependencies]
mkdocs = "^1.6.0"
Expand Down

0 comments on commit 2f19075

Please sign in to comment.