feat: add Docker containerization with multi-stage build

Includes .dockerignore, Dockerfile with cargo-chef caching, and Justfile commands for building/running containerized app. Updates console-logger to support both JSON and pretty-printed logs based on LOG_JSON env var.
This commit is contained in:
2026-01-04 20:06:56 -06:00
parent edf271bcc6
commit 9de3c84f00
15 changed files with 238 additions and 244 deletions
+25 -17
View File
@@ -1,26 +1,34 @@
default:
just --list
dev:
just dev-json | hl --config .hl.config.toml -P
dev-json:
LOG_JSON=true UPSTREAM_URL=/tmp/xevion-api.sock bunx concurrently --raw --prefix none "bun run --silent --cwd web dev --port 5173" "cargo watch --quiet --exec 'run --quiet -- --listen localhost:8080 --listen /tmp/xevion-api.sock --downstream http://localhost:5173'"
setup:
bun install --cwd web
cargo build
build:
bun run --cwd web build
cargo build --release
serve:
LOG_JSON=true bunx concurrently --raw --prefix none "SOCKET_PATH=/tmp/xevion-bun.sock bun --preload ../console-logger.js --silent --cwd web/build index.js" "target/release/api --listen localhost:8080 --listen /tmp/xevion-api.sock --downstream /tmp/xevion-bun.sock"
check:
bun run --cwd web format
bun run --cwd web lint
bun run --cwd web check
cargo clippy --all-targets
cargo fmt --check
build:
bun run --cwd web build
cargo build --release
dev:
just dev-json | hl --config .hl.config.toml -P
dev-json:
LOG_JSON=true UPSTREAM_URL=/tmp/xevion-api.sock bunx concurrently --raw --prefix none "bun run --silent --cwd web dev --port 5173" "cargo watch --quiet --exec 'run --quiet -- --listen localhost:8080 --listen /tmp/xevion-api.sock --downstream http://localhost:5173'"
serve:
just serve-json | hl --config .hl.config.toml -P
serve-json:
LOG_JSON=true bunx concurrently --raw --prefix none "SOCKET_PATH=/tmp/xevion-bun.sock bun --preload ../console-logger.js --silent --cwd web/build index.js" "target/release/api --listen localhost:8080 --listen /tmp/xevion-api.sock --downstream /tmp/xevion-bun.sock"
docker-image:
docker build -t xevion-dev .
docker-run port="8080":
just docker-run-json {{port}} | hl --config .hl.config.toml -P
docker-run-json port="8080":
docker run -p {{port}}:8080 xevion-dev