fix: curl na imagem para o healthcheck do Coolify; rótulo de versão vem do CHANGELOG
CI / Trivy (dependências, segredos e configuração) (push) Successful in 7s
CI / Testes e imagem Docker (linux/arm64) (push) Successful in 3m59s
Release / Plano (reaproveitar a imagem?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Publica a imagem (linux/arm64) (push) Successful in 17s
Release / Cria a release no Gitea (push) Successful in 4s
CI / Trivy (dependências, segredos e configuração) (push) Successful in 7s
CI / Testes e imagem Docker (linux/arm64) (push) Successful in 3m59s
Release / Plano (reaproveitar a imagem?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Publica a imagem (linux/arm64) (push) Successful in 17s
Release / Cria a release no Gitea (push) Successful in 4s
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c932ce5133
commit
72ccb52cfa
4 files changed
+28
-2
No files matched your search
@@ -65,7 +65,12 @@ jobs:
|
||||
|
||||
- name: Build
|
||||
if: ${{ steps.plano.outputs.reuse != 'true' }}
|
||||
run: docker build --target runtime --build-arg VERSION="${{ gitea.ref_name }}" --build-arg REVISION="${{ gitea.sha }}" -t inbraille:ci .
|
||||
# O rótulo de versão vem do CHANGELOG (primeira versão numerada), não do nome da
|
||||
# branch: a mesma imagem é reaproveitada pela tag, então o rótulo precisa valer para ela.
|
||||
run: |
|
||||
version=$(grep -m1 -oE '^## \[[0-9]+\.[0-9]+\.[0-9]+\]' CHANGELOG.md | tr -d '#[] ')
|
||||
echo "versão da imagem: $version"
|
||||
docker build --target runtime --build-arg VERSION="$version" --build-arg REVISION="${{ gitea.sha }}" -t inbraille:ci .
|
||||
|
||||
- name: Trivy na imagem
|
||||
if: ${{ steps.plano.outputs.reuse != 'true' }}
|
||||
|
||||
+11
-1
@@ -13,6 +13,15 @@ Everything notable in InBraille is recorded here. The format follows
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [1.3.3] - 2026-11-02
|
||||
|
||||
### Changed
|
||||
|
||||
- The image now ships `curl`, so the Coolify healthcheck (which runs `curl` inside the container)
|
||||
works; it is enabled on `/`. The image `HEALTHCHECK` still uses Python.
|
||||
- The `org.opencontainers.image.version` label comes from the first numbered CHANGELOG entry
|
||||
instead of the branch name (it said `main` on the 1.3.2 image).
|
||||
|
||||
## [1.3.2] - 2026-11-02
|
||||
|
||||
### Changed
|
||||
@@ -61,7 +70,8 @@ sources of the live plate preview (`public/preview.js`) and of the browser-side
|
||||
- Security hardening of the API and the container (see SECURITY.md).
|
||||
- Dependencies upgraded; all Trivy findings (critical, high and medium) resolved.
|
||||
|
||||
[Unreleased]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/compare/v1.3.2...HEAD
|
||||
[Unreleased]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/compare/v1.3.3...HEAD
|
||||
[1.3.3]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/compare/v1.3.2...v1.3.3
|
||||
[1.3.2]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/compare/v1.3.1...v1.3.2
|
||||
[1.3.1]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/releases/tag/v1.3.1
|
||||
[1.1.0]: https://git.lucasrguerra.dev.br/lucasrguerra/inbraille/releases/tag/v1.1.0
|
||||
|
||||
@@ -47,6 +47,10 @@ LABEL org.opencontainers.image.title="InBraille" \
|
||||
org.opencontainers.image.version="${VERSION}" \
|
||||
org.opencontainers.image.revision="${REVISION}"
|
||||
|
||||
# curl: the Coolify healthcheck runs `curl` inside the container (the image HEALTHCHECK uses Python).
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY requirements.txt .
|
||||
# pip/setuptools (and the libraries vendored inside pip) are build tools: remove them from the runtime image.
|
||||
RUN pip install --prefer-binary -r requirements.txt \
|
||||
|
||||
@@ -69,6 +69,13 @@ grep -qi '^x-content-type-options: nosniff' <<< "$head" || falhou "/: sem X-Cont
|
||||
grep -qi '^x-frame-options: DENY' <<< "$head" || falhou "/: sem X-Frame-Options"
|
||||
grep -qi '^cache-control: .*no-cache' <<< "$head" || falhou "/: sem Cache-Control no-cache (as páginas precisam revalidar)"
|
||||
|
||||
# O healthcheck do Coolify roda `curl` dentro do contêiner: ele precisa existir e funcionar.
|
||||
docker exec "$app" curl -fsS -o /dev/null http://127.0.0.1:3000/ || falhou "o curl dentro da imagem não alcança a aplicação (healthcheck do Coolify)"
|
||||
|
||||
# O rótulo de versão da imagem é um número (não o nome de uma branch).
|
||||
versao=$(docker inspect -f '{{index .Config.Labels "org.opencontainers.image.version"}}' "$imagem")
|
||||
[[ "$versao" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || falhou "rótulo de versão inválido: '$versao'"
|
||||
|
||||
# Roda sem privilégios.
|
||||
[ "$(docker exec "$app" id -u)" = 10001 ] || falhou "o processo não roda como o usuário 10001"
|
||||
|
||||
|
||||
Reference in new issue
Block a user