add seed database and entrypoint for data sync
This commit is contained in:
@@ -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.
@@ -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 "$@"
|
||||
Reference in New Issue
Block a user