-
Notifications
You must be signed in to change notification settings - Fork 216
/
start.sh
executable file
·32 lines (29 loc) · 1.18 KB
/
start.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
set -e
# if there is no .env file, create one
if [ ! -f .env ]; then
echo "POSTGRES_USERNAME=$(openssl rand -hex 12)" >> .env
echo "POSTGRES_PASSWORD=$(openssl rand -hex 12)" >> .env
echo "JUPYTER_TOKEN=$(openssl rand -hex 24)" >> .env
echo "AI_BASIC_AUTH_USERNAME=$(openssl rand -hex 12)" >> .env
echo "AI_BASIC_AUTH_PASSWORD=$(openssl rand -hex 12)" >> .env
echo "OPENAI_API_KEY=sk-placeholder" >> .env
echo "LOGIN_JWT_SECRET=$(openssl rand -hex 24)" >> .env
echo "AUTH_JWT_SECRET=$(openssl rand -hex 24)" >> .env
echo "ENVIRONMENT_VARIABLES_ENCRYPTION_KEY=$(openssl rand -hex 32)" >> .env
echo "WORKSPACE_SECRETS_ENCRYPTION_KEY=$(openssl rand -hex 32)" >> .env
echo "DATASOURCES_ENCRYPTION_KEY=$(openssl rand -hex 32)" >> .env
fi
# Check if docker compose exists, if it does use it
# otherwise use docker-compose
if command -v docker compose > /dev/null 2>&1; then
COMPOSE_CMD="docker compose"
elif command -v docker-compose > /dev/null 2>&1; then
COMPOSE_CMD="docker-compose"
else
echo "Neither docker compose nor docker-compose is installed, exiting..."
exit 1
fi
# Running docker compose up
$COMPOSE_CMD up -d
echo "Briefer is now running at port 3000"