hezarfen_backend
Clone
https://git.tahinli.com/Hezarfen/hezarfen_backend.git
0 watching0 forksRust8.3 MiB6d68754Ahmet Kaan Gümüş2 months ago566 commits
| 1 | # CI-only runtime image: built from the gnu binary the workflow already |
| 2 | # compiled and stripped on ubuntu-24.04 — never from source here (a second |
| 3 | # rust compile blows the runner's disk; the source `Containerfile` stays for |
| 4 | # laptop `podman compose up --build`). |
| 5 | # |
| 6 | # Build context is stage/, populated by CI: |
| 7 | # docker build -f deploy/Containerfile.runtime \ |
| 8 | # -t localhost/hezarfen_backend:$GITHUB_SHA stage/ |
| 9 | # with stage/hezarfen_backend (the binary) and stage/migrations/. |
| 10 | FROM docker.io/library/debian:trixie-slim |
| 11 | |
| 12 | # curl answers the compose healthcheck; ca-certificates for TLS the backend |
| 13 | # may dial (OTLP endpoints, the AI bridge). |
| 14 | RUN apt-get update && \ |
| 15 | apt-get install -y --no-install-recommends curl ca-certificates && \ |
| 16 | rm -rf /var/lib/apt/lists/* && \ |
| 17 | useradd --system --uid 10001 hezarfen && \ |
| 18 | mkdir /data && chown hezarfen:hezarfen /data |
| 19 | |
| 20 | # Migrations MUST sit beside the binary at /app/hezarfen_backend: the CI |
| 21 | # runner's CARGO_MANIFEST_DIR does not exist in the image, so the app resolves |
| 22 | # the schema next to the executable (migrations_path in the source). |
| 23 | COPY hezarfen_backend /app/hezarfen_backend |
| 24 | COPY migrations /app/migrations |
| 25 | |
| 26 | WORKDIR /app |
| 27 | USER hezarfen |
| 28 | |
| 29 | # DATABASE_URL is deliberately not baked in: compose constructs it in |
| 30 | # `environment:` from POSTGRES_* (see compose.yaml), which also wins over the |
| 31 | # operator's env_file. |
| 32 | ENV HOST=0.0.0.0 \ |
| 33 | PORT=7656 |
| 34 | |
| 35 | EXPOSE 7656 |
| 36 | |
| 37 | ENTRYPOINT ["/app/hezarfen_backend"] |