-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
·60 lines (49 loc) · 1.17 KB
/
start.sh
File metadata and controls
executable file
·60 lines (49 loc) · 1.17 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
# Set working directory path
WORKING_DIR=$(pwd)
# Define configuration file paths
SERVER_TOML="server.toml"
WORKER_TOML="workspace/worker.toml"
# Check and create server.toml if necessary
if [ ! -f "$SERVER_TOML" ]; then
echo "Creating $SERVER_TOML..."
cat <<EOL > "$SERVER_TOML"
host_path = "$WORKING_DIR"
host_mounts = []
redis_host = "redis"
task_timeout = 600
[llm.openai]
api_key = "YOUR_API_KEY"
model = "gpt-4o"
# For Anthropic models
# [llm.anthropic]
# api_key = "YOUR_API_KEY"
# model = "claude-3-5-sonnet-20240620"
EOL
else
echo "$SERVER_TOML already exists."
fi
# Check and create worker.toml if necessary
if [ ! -f "$WORKER_TOML" ]; then
echo "Creating $WORKER_TOML..."
cat <<EOL > "$WORKER_TOML"
[database.sqlite.demo]
host = "files/demo.db"
EOL
else
echo "$WORKER_TOML already exists."
fi
# check files/dev.db exists and create if necessary
if [ ! -f "files/dev.db" ]; then
echo "Creating files/dev.db..."
touch "files/dev.db"
else
echo "files/dev.db already exists."
fi
# build dropbase/worker
docker image rm dropbase/worker
docker build -t dropbase/worker worker/.
# Set host path
export HOST_PATH=$(pwd)
# Start containers
docker compose up