aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrtkay123 <dev@kanjala.com>2026-02-09 13:44:04 +0200
committerrtkay123 <dev@kanjala.com>2026-02-09 13:44:04 +0200
commitd2339ca8869af12c0fd8cf6fc87986f06b487de9 (patch)
tree132eb9c26bfe2ee09ee500212110e3bf841616ef
parentbac76a98bf4e90610d0a7105d2ebe6872dc147d4 (diff)
downloadsellershut-d2339ca8869af12c0fd8cf6fc87986f06b487de9.tar.bz2
sellershut-d2339ca8869af12c0fd8cf6fc87986f06b487de9.zip
build: compose file
-rw-r--r--compose.yaml41
-rw-r--r--sellershut/src/state/mod.rs4
2 files changed, 44 insertions, 1 deletions
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
};