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:
10
start.sh
10
start.sh
@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user