Commit Graph

4 Commits

Author SHA1 Message Date
darroyo d101d6df0f feat: add HTTP healthcheck endpoint via quarkus-smallrye-health
CI / Build Native (push) Failing after 16m25s
- pom.xml: add quarkus-smallrye-health dependency.
  Exposes /q/health/live and /q/health/ready endpoints (liveness
  and readiness probes for Quarkus apps).
- Dockerfile: install curl-minimal in the microdnf layer so the
  container has a real HTTP client. quarkus-micro-image is based
  on UBI 9 minimal and doesn't ship with curl by default.
- compose.yaml: healthcheck now hits GET /q/health/live with
  curl -f instead of the previous kill -0 1 (which only proved
  the process was alive, not that the HTTP server was responding).

The next CI run will rebuild the native binary with the health
extension baked in; old images pulled from :latest will keep
working since this is additive.
2026-08-13 13:01:20 -04:00
darroyo 9646236fa8 feat: externalize config via env vars
CI / Build Native (push) Successful in 20m1s
- Add .env.example with all configurable variables documented
  (DB URL, HTTP port/host, cookie, JWT issuer/keys, log level)
- Remove hardcoded -Dquarkus.http.host from Dockerfile ENTRYPOINT
  (application.properties already sets the default; env vars
  can now override it at runtime without conflicting with -D flags)

All env vars follow Quarkus's auto-binding convention:
property.key → PROPERTY_KEY (uppercase)

Most useful for production:
- QUARKUS_DATASOURCE_JDBC_URL: DB file path
- QUARKUS_HTTP_PORT: HTTP port
- QUARKUS_HTTP_HOST: bind interface
- APP_AUTH_COOKIE_SECURE: enable Secure flag behind HTTPS
- MP_JWT_VERIFY_PUBLICKEY_LOCATION: externalize RSA keys
2026-08-13 09:27:53 -04:00
darroyo d067110103 fix(ci): stage native binary in build-output/ to bypass .dockerignore
CI / Build Native (push) Failing after 8m52s
The .dockerignore has 'target' which excludes the target/
directory from the docker build context. The Dockerfile was
COPYing the binary from target/, so docker build failed with
'file not found in build context or excluded by .dockerignore'.

Fix: copy the binary to build-output/ (a non-excluded path)
before docker build, and update the Dockerfile to copy from
build-output/.

- Add 'Stage binary for Docker' step that does:
    mkdir -p build-output
    cp target/shot-crafter-calculator-1.0.0-runner build-output/
- Dockerfile COPY now reads build-output/shot-crafter-calculator-1.0.0-runner
- build-output/ is not in .dockerignore -> only the binary
  (~117MB) ships in the build context, not the whole target/
  tree (~200MB with classes, generated-sources, node binaries, etc.)
2026-08-12 19:44:14 -04:00
darroyo 9db3f7a914 ci: build native Docker image and push to Gitea Container Registry
CI / Build Native (push) Failing after 2s
CI / Build JVM (push) Failing after 7s
CI / Build & Push Native Image (push) Has been skipped
Adds:
- Dockerfile based on quarkus-micro-image:2.0 (~50MB base)
  Runs the native binary as non-root user 1001, exposes 8080
- .dockerignore to exclude build artifacts
- Gitea Actions workflow with 3 parallel jobs:
  - build-jvm: standard JAR (mvn package)
  - build-native: GraalVM native binary (mvn package -Pnative)
  - docker-native: takes the native binary artifact, builds
    the container image and pushes to
    gitea.danielarroyo.cl/proyectos/shot-crafter-calculator
    with tags 'latest' and short SHA

Triggers: push to main and PRs (docker job only on push).
Required secrets: GITEA_USERNAME, GITEA_TOKEN (write:packages).
2026-08-12 16:16:51 -04:00