Skip to content

Commit

Permalink
redis single dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandoks committed Dec 5, 2024
1 parent 7dfef40 commit eb9a9d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion .kamal/secrets
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ POSTGRES_DB=$(echo "$SECRETS" | grep "MainDatabaseName" | sed "s/MainDatabaseNam
PGUSER=$POSTGRES_USER
PGDATABASE=$POSTGRES_DB

REDIS_PASSWORD=$(echo "$SECRETS" | grep "MainRedisPassword" | sed "s/MainRedisPassword=//")
MAIN_REDIS_PASSWORD=$(echo "$SECRETS" | grep "MainRedisPassword" | sed "s/MainRedisPassword=//")
MAIN_REDIS_HOST=redis
MAIN_REDIS_PORT=6379

# Option 3: Read secrets via kamal secrets helpers
# These will handle logging in and fetching the secrets in as few calls as possible
Expand Down
4 changes: 2 additions & 2 deletions config/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ accessories:
- web
env:
secret:
- REDIS_PASSWORD
cmd: "/bin/sh -c 'redis-server --requirepass $REDIS_PASSWORD'"
- MAIN_REDIS_PASSWORD
cmd: "/bin/sh -c 'redis-server --requirepass $MAIN_REDIS_PASSWORD'"
directories:
- redis-data:/data
1 change: 1 addition & 0 deletions packages/core/src/redis/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const MAIN_REDIS_PASSWORD = process.env.MAIN_REDIS_PASSWORD;
const MAIN_REDIS_HOST = process.env.MAIN_REDIS_HOST;
const MAIN_REDIS_PORT = process.env.MAIN_REDIS_PORT;

console.log("HERE:", MAIN_REDIS_PORT);
export const redis = createClient({
password: MAIN_REDIS_PASSWORD,
socket: {
Expand Down

0 comments on commit eb9a9d7

Please sign in to comment.