Skip to content

Commit

Permalink
feat: migrate to keydb
Browse files Browse the repository at this point in the history
  • Loading branch information
rin-yato committed Sep 25, 2024
1 parent e871ada commit fffc54b
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 16 deletions.
33 changes: 33 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
BAKONG_TOKEN=""

DB_URL=""
REDIS_PASSWORD=""

GOOGLE_CLIENT_ID=""
GOOGLE_CLIENT_SECRET=""

R2_BUCKET=""
R2_URL=""
R2_PUBLIC_URL=""
R2_ACCESS_KEY=""
R2_SECRET_ACCESS_KEY=""

AXIOM_DATASET=""
AXIOM_TOKEN=""

API_URL="http://localhost:3050"
WEB_URL="http://localhost:3000"
BASE_URL="localhost"

NODE_ENV="development"


# Web
VITE_API_URL="http://localhost:3050"
VITE_URL="http://localhost:3000"
VITE_DOMAIN="localhost"


# SDK
SDK_API_URL="http://localhost:3050"
SDK_WEB_URL="http://localhost:3000"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ node_modules
.env.test.local
.env.production.local
.env.compose
keydb.conf

# Testing
coverage
Expand Down
6 changes: 5 additions & 1 deletion apps/api/src/task/webhook/tasker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export class WebhookTasker implements Tasker {

async process(job: WebhookJob) {
const response = await ky
.post(job.data.webhookUrl, { retry: 0, redirect: "error" })
.post(job.data.webhookUrl, {
retry: 0,
redirect: "error",
json: { checkoutId: job.data.checkoutId },
})
.then(ok)
.catch(err);

Expand Down
25 changes: 10 additions & 15 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ services:
depends_on:
postgres:
condition: service_healthy
dragonfly:
keydb:
condition: service_healthy

postgres:
Expand All @@ -71,27 +71,22 @@ services:
retries: 5
restart: unless-stopped

dragonfly:
image: "docker.dragonflydb.io/dragonflydb/dragonfly"
ulimits:
memlock: -1
command:
- "--cluster_mode=emulated"
- "--lock_on_hashtags"
environment:
- DFLY_requirepass=${DFLY_requirepass}
expose:
- 6379
keydb:
image: "eqalpha/keydb"
command: keydb-server /etc/keydb/keydb.conf
ports:
- 6379:6379
volumes:
- dragonfly:/data
- keydb:/data
- ./keydb.conf:/etc/keydb/keydb.conf
healthcheck:
test: ["CMD", "redis-cli", "PING"]
test: ["CMD", "redis-cli -a $REDIS_PASSWORD", "PING"]
interval: 10s
timeout: 5s
retries: 5
restart: unless-stopped

volumes:
postgres:
dragonfly:
keydb:
letsencrypt:
5 changes: 5 additions & 0 deletions keydb.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
bind $KEYDB_BIND
protected-mode yes
appendonly yes
requirepass $KEYDB_PASS

0 comments on commit fffc54b

Please sign in to comment.