Containerize
This commit is contained in:
parent
71dcefcf01
commit
dee736bd54
7 changed files with 59 additions and 8 deletions
15
docker-entrypoint.sh
Executable file
15
docker-entrypoint.sh
Executable file
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
DB_PATH="/data/mstbot.db"
|
||||
SCHEMA="/app/schema.sql"
|
||||
|
||||
if [ ! -f "$DB_PATH" ]; then
|
||||
echo "SQLite DB not found, initializing…"
|
||||
mkdir -p "$(dirname "$DB_PATH")"
|
||||
sqlite3 "$DB_PATH" < "$SCHEMA"
|
||||
else
|
||||
echo "SQLite DB exists, skipping init"
|
||||
fi
|
||||
|
||||
exec "$@"
|
||||
Loading…
Add table
Add a link
Reference in a new issue