File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,6 @@ ENV DATA_DIR=/data
185185ENV DATA_CACHE_DIR=$DATA_DIR/.sourcebot
186186ENV DATABASE_DATA_DIR=$DATA_CACHE_DIR/db
187187ENV REDIS_DATA_DIR=$DATA_CACHE_DIR/redis
188- ENV DATABASE_URL="postgresql://postgres@localhost:5432/sourcebot"
189188ENV REDIS_URL="redis://localhost:6379"
190189ENV SRC_TENANT_ENFORCEMENT_MODE=strict
191190ENV SOURCEBOT_PUBLIC_KEY_PATH=/app/public.pem
Original file line number Diff line number Diff line change 11#! /bin/sh
22set -e
33
4+ # Check if DATABASE_URL is not set
5+ if [ -z " $DATABASE_URL " ]; then
6+ # Check if the individual database variables are set and construct the URL
7+ if [ -n " $DATABASE_HOST " ] && [ -n " $DATABASE_USERNAME " ] && [ -n " $DATABASE_PASSWORD " ] && [ -n " $DATABASE_NAME " ]; then
8+ DATABASE_URL=" postgresql://${DATABASE_USERNAME} :${DATABASE_PASSWORD} @${DATABASE_HOST} /${DATABASE_NAME} "
9+
10+ if [ -n " $DATABASE_ARGS " ]; then
11+ DATABASE_URL=" ${DATABASE_URL} ?$DATABASE_ARGS "
12+ fi
13+
14+ export DATABASE_URL
15+ else
16+ # Otherwise, fallback to a default value
17+ DATABASE_URL=" postgresql://postgres@localhost:5432/sourcebot"
18+ export DATABASE_URL
19+ fi
20+ fi
21+
422if [ " $DATABASE_URL " = " postgresql://postgres@localhost:5432/sourcebot" ]; then
523 DATABASE_EMBEDDED=" true"
624fi
You can’t perform that action at this time.
0 commit comments