NOT DONE YET - allow containerization

a bunch was restructured to make it amenable to docker.

it works fine, except when writing to the db. trying to log in (thus creating a session)
will have Lapis throw "attempt to write a readonly database"
This commit is contained in:
2025-05-23 04:46:10 +03:00
parent af20b626d5
commit 0d7ed52679
7 changed files with 48 additions and 7 deletions

View File

@ -1,12 +1,18 @@
#!/bin/bash
set -e
start() {
lapis serve
}
first_launch() {
echo "Setting up for the first time"
touch ".first_launch.$LAPIS_ENVIRONMENT"
mkdir -p secrets
local SECRET
SECRET="$(openssl rand -hex 32)"
echo "return { key = \"${SECRET}\",}" > secrets/secrets.lua
touch "secrets/.touched.$LAPIS_ENVIRONMENT"
mkdir -p data/db
luajit schema.lua
lapis migrate
@ -22,7 +28,7 @@ fi
echo "Starting in $LAPIS_ENVIRONMENT"
if ! [ -f ".first_launch.$LAPIS_ENVIRONMENT" ]; then
if ! [ -f ".touched.$LAPIS_ENVIRONMENT" ]; then
first_launch
fi