Files
tavolo/server/Cargo.toml
T
woggioni ed90a2a5a6
CI / Build and push docker image (push) Successful in 7m1s
Base the release image on scratch
Build the backend as a fully static musl binary (rust:1-alpine +
x86_64-unknown-linux-musl) and run it in a scratch image with only the
binary and the compiled frontend: 32 MB instead of ~110 MB, no shell,
package manager or libc, running as the numeric user 10001:10001.

The binary moves to /usr/local/bin/tavolo so `tavolo migrate` and
`tavolo serve` resolve on PATH in compose and Kubernetes. TLS for OIDC and
Postgres validates against Mozilla's roots embedded in the binary by
webpki-roots, so no certificate files are needed; the OTLP client is built
without a TLS backend, so OTEL_EXPORTER_OTLP_ENDPOINT must be http://
(documented). The Docker HEALTHCHECK is removed since scratch has no curl:
Kubernetes probes /api/health over HTTP and Compose gates on its dependency
checks. `strip = "symbols"` trims the release binary.

Validated with docker compose up --build: migrations, sessions, lobby
creation, the OIDC discovery redirect and the SPA all work, proving musl DNS
resolution for the postgres/redis/mockoauth service names.
2026-10-02 14:34:58 +00:00

47 lines
1.5 KiB
TOML

[workspace]
resolver = "2"
members = [
"crates/tavolo-platform",
"crates/tavolo-scopone",
"crates/tavolo-app",
]
[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://gitea.woggioni.net/woggioni/tavolo"
description = "Multiplayer card-game platform backend"
[workspace.dependencies]
async-trait = "0.1"
axum = { version = "0.8", features = ["ws", "macros"] }
base64 = "0.22"
chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4", features = ["derive", "env"] }
futures-util = "0.3"
hex = "0.4"
jsonwebtoken = "9"
percent-encoding = "2"
rand = "0.8"
redis = { version = "0.32", features = ["tokio-comp", "connection-manager", "script"] }
regex = "1"
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }
serde = { version = "1", features = ["derive"] }
serde_json = { version = "1", features = ["preserve_order"] }
sha2 = "0.10"
sqlx = { version = "0.8", default-features = false, features = ["runtime-tokio", "tls-rustls", "postgres", "chrono", "uuid", "json", "migrate", "macros"] }
thiserror = "2"
tokio = { version = "1", features = ["full"] }
tower = { version = "0.5", features = ["util"] }
tower-http = { version = "0.6", features = ["cors", "fs", "trace"] }
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
url = "2"
uuid = { version = "1", features = ["v4", "serde"] }
[profile.release]
lto = "thin"
codegen-units = 1
strip = "symbols"