Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6489d91

Browse files
committed
generated file: startup.sh
1 parent f2cff24 commit 6489d91

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

‎startup.sh‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
# Load environment variables from .env file
5+
source .env
6+
7+
# Check if environment variables are set
8+
if [[ -z "$OPENAI_API_KEY" ]]; then
9+
echo "Error: OPENAI_API_KEY environment variable is not set."
10+
exit 1
11+
fi
12+
13+
if [[ -z "$DATABASE_URL" ]]; then
14+
echo "Error: DATABASE_URL environment variable is not set."
15+
exit 1
16+
fi
17+
18+
if [[ -z "$SECRET_KEY" ]]; then
19+
echo "Error: SECRET_KEY environment variable is not set."
20+
exit 1
21+
fi
22+
23+
# Initialize the database
24+
alembic upgrade head
25+
26+
# Start the application server using uvicorn
27+
uvicorn main:app --host 0.0.0.0 --port 8000

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /