-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathdocker-entrypoint.sh
More file actions
38 lines (30 loc) · 867 Bytes
/
docker-entrypoint.sh
File metadata and controls
38 lines (30 loc) · 867 Bytes
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
#!/bin/sh
echo "Apply database migrations"
uv run python manage.py migrate
if [ $? -ne 0 ]; then
echo "Failed to apply database migrations."
exit 1
else
echo "Database migrations applied successfully."
fi
if [ ! -f /code/.docker/initialized ]; then
echo "First-time setup: running add_data.py"
uv run python add_data.py
if [ $? -ne 0 ]; then
echo "Failed to run add_data.py"
exit 1
fi
echo "First-time setup: running add_more_test_data.py"
uv run python add_more_test_data.py
if [ $? -ne 0 ]; then
echo "Failed to run add_more_test_data.py"
exit 1
fi
mkdir -p /code/.docker
touch /code/.docker/initialized
echo "First-time setup completed successfully"
else
echo "Database already initialized, skipping data setup"
fi
echo "Starting server"
exec "$@"