add seed database and entrypoint for data sync

This commit is contained in:
2026-10-29 17:23:10 +08:00
parent b5505cc1b0
commit 48b7640ca5
3 changed files with 16 additions and 0 deletions
+4
View File
@@ -20,4 +20,8 @@ EXPOSE 34173
VOLUME /app/backend/data
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["python", "-m", "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "34173", "--workers", "1"]
Binary file not shown.
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
set -e
mkdir -p ./data
if [ ! -f ./data/linkup.db ]; then
if [ -f ./seed/linkup.db ]; then
echo "[entrypoint] Seeding database from ./seed/linkup.db"
cp ./seed/linkup.db ./data/linkup.db
else
echo "[entrypoint] No seed database found, starting with empty database"
fi
fi
exec "$@"