Commit Graph

4 Commits

Author SHA1 Message Date
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