Commit Graph

5 Commits

Author SHA1 Message Date
darroyo fb021b165b ci: point Docker registry at internal Gitea (10.5.0.195:3000)
CI / Build Native (push) Successful in 6m17s
Cut the dependency on the public hostname gitea.danielarroyo.cl and
push straight to the LAN Gitea instance. Internal Gitea is plain HTTP,
so the docker daemon on the LXC needs 'insecure-registries' set, and
the gitea-runner-lxc has to be re-registered against the new URL
(separate manual steps; not in this repo).

- ci.yml: docker login, both docker tag, both push_with_retry, and
  docker logout now target 10.5.0.195:3000
- compose.yaml: image URL switched to 10.5.0.195:3000

The CI workflow itself, the Dockerfile, and the build command are
unchanged - only the registry target moved.
2026-08-14 18:29:08 -04:00
darroyo 6421a91148 ci: revert to Docker image build + registry push (no deploy)
CI / Build Native (push) Failing after 14m36s
Drop the LXC deploy step. Pipeline now stops at publishing the image
to the Gitea registry; deployment is handled out of band.

Restored:
- Dockerfile (multi-stage: curl-builder + quarkus-micro-image:2.0,
  generic via build-output/*-runner wildcard, COPY --chown=1001:1001)
- compose.yaml (one-shot install of the published image)
- .dockerignore (excludes build-output/)

CI workflow:
- Installs docker-buildx (needed for COPY --chown)
- Uses docker buildx build
- chmod 775 and echo securerandom happen in the 'Stage binary for Docker'
  step; the final image has no RUN commands
- Tags :latest and :<short-sha>, pushes with retry

No deploy step. Pull the image with docker compose / run it manually.
2026-08-13 20:25:43 -04:00
darroyo a2fb5cc521 ci: deploy native binary directly to LXC via SSH (drop Docker/registry)
CI / Build Native (push) Failing after 12m4s
Switch the runtime from a Docker image to a systemd service running the
native binary on the LXC host. The CI still uses Docker for the build
environment (maven:3.9.6-eclipse-temurin-21), but stops at producing the
static native binary.

Pipeline changes:
- Drop docker.io, docker-buildx, docker buildx, docker push, registry.
- Drop Dockerfile, compose.yaml, .dockerignore (no longer needed).
- Build native binary in CI container, SCP to LXC, run deploy script.
- Deploy script stops the service, swaps the binary, starts it, hits
  /q/health/live to verify.

LXC one-time setup (manual, run on the host):
- useradd runner (UID 1001)
- mkdir /opt/shot-crafter-calculator/{data,keys,deploy}
- copy RSA JWT keys into keys/
- install /etc/systemd/system/shot-crafter-calculator.service
- install /usr/local/bin/deploy-shot-crafter-calculator.sh
- useradd deployer + ssh keypair for the CI
- store DEPLOY_SSH_KEY secret in Gitea

Bootstrap the first deploy manually with scp + ssh before relying on CI.
2026-08-13 20:05:17 -04:00
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 12d382d253 feat: add compose.yaml for one-line install
CI / Build Native (push) Has been cancelled
docker compose pull
  docker compose up -d
  docker compose logs -f

  - Single service `shot-crafter` pulling from
    gitea.danielarroyo.cl/proyectos/shot-crafter-calculator:latest
  - Named volume `shot-crafter-data` mounted at /work/data
    so the H2 DB persists across `down`/`up` cycles
  - env vars inline (overridable via -e or .env): DB URL,
    HTTP port/host, cookie name + secure flag
  - healthcheck using `kill -0 1` (the native binary is PID 1,
    POSIX-portable, no extra binaries needed)
  - restart: unless-stopped so it survives Docker daemon restarts

Ver .env.example para la lista completa de variables operacionales.
2026-08-13 12:48:03 -04:00