From d2339ca8869af12c0fd8cf6fc87986f06b487de9 Mon Sep 17 00:00:00 2001 From: rtkay123 Date: Mon, 9 Feb 2026 13:44:04 +0200 Subject: build: compose file --- compose.yaml | 41 +++++++++++++++++++++++++++++++++++++++++ sellershut/src/state/mod.rs | 4 +++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 compose.yaml diff --git a/compose.yaml b/compose.yaml new file mode 100644 index 0000000..bcacb19 --- /dev/null +++ b/compose.yaml @@ -0,0 +1,41 @@ +name: sellershut + +services: + db: + image: docker.io/postgres:18.1-alpine + restart: always + shm_size: 128mb + environment: + POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password} + PGDATA: /data/postgres + ports: + - 5432:5432 + networks: + - sellershut + volumes: + - db:/data/postgres + healthcheck: + test: ["CMD-SHELL", "pg_isready -U postgres"] + interval: 10s + timeout: 5s + retries: 3 + + cache: + image: docker.io/valkey/valkey:9.0.1-alpine + restart: always + ports: + - 6379:6379 + networks: + - sellershut + healthcheck: + test: ["CMD-SHELL", "valkey-cli ping"] + interval: 10s + timeout: 5s + retries: 3 + +volumes: + db: + driver: local + +networks: + sellershut: diff --git a/sellershut/src/state/mod.rs b/sellershut/src/state/mod.rs index 1a28381..84358a2 100644 --- a/sellershut/src/state/mod.rs +++ b/sellershut/src/state/mod.rs @@ -17,10 +17,12 @@ impl AppState { .with_redirect_url(&config.oauth.redirect_url); let cache = { + let host = config.cache.redis_dsn.host_str(); let c = RedisManager::new(&config.cache).await?; - debug!("testing cache connection"); + debug!(host = host, "testing cache connection"); // test connection c.get().await.inspect_err(|e| error!("{e}"))?; + debug!(host = host, "cache connection ok"); c }; -- cgit v1.2.3