forge
Explore
Log in

Don't you dare go Hollow

hezarfen_backend

Clone
★ 0

0 watching0 forksRust8.3 MiBc44f362Ahmet Kaan Gümüş2 months ago520 commits

Containerfile.runtime37 lines, 1.4 KiBHistoryRawDownload
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/.
10FROM 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).
14RUN 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).
23COPY hezarfen_backend /app/hezarfen_backend
24COPY migrations /app/migrations
25
26WORKDIR /app
27USER 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.
32ENV HOST=0.0.0.0 \
33 PORT=7656
34
35EXPOSE 7656
36
37ENTRYPOINT ["/app/hezarfen_backend"]