xxx
Browse files- Dockerfile +1 -0
- entrypoint.sh +17 -0
Dockerfile
CHANGED
@@ -43,4 +43,5 @@ ENV HOME=/home/user \
|
|
43 |
EXPOSE 7860
|
44 |
|
45 |
# Run the server using uvicorn with app.py as the entrypoint
|
|
|
46 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
43 |
EXPOSE 7860
|
44 |
|
45 |
# Run the server using uvicorn with app.py as the entrypoint
|
46 |
+
ENTRYPOINT ["/app/entrypoint.sh"]
|
47 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
entrypoint.sh
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/bash
|
2 |
+
set -e
|
3 |
+
|
4 |
+
# Start MariaDB in the background
|
5 |
+
mysqld_safe --datadir=/var/lib/mysql &
|
6 |
+
|
7 |
+
# Wait for MariaDB to be ready
|
8 |
+
until mysqladmin ping --silent; do
|
9 |
+
echo "Waiting for MariaDB..."
|
10 |
+
sleep 2
|
11 |
+
done
|
12 |
+
|
13 |
+
# (Optional) Initialize DB/user if needed
|
14 |
+
# mysql -u root -e "CREATE DATABASE IF NOT EXISTS $MARIADB_DATABASE;"
|
15 |
+
|
16 |
+
# Start your FastAPI app
|
17 |
+
exec "$@"
|