This commit is contained in:
ducklet 2024-02-03 15:12:35 +01:00
commit 3cbff4c68e
11 changed files with 344 additions and 0 deletions

16
scripts/build Executable file
View file

@ -0,0 +1,16 @@
#!/bin/sh -eu
: "${DOCKER_BIN:=docker}"
here=$(dirname "$(realpath "$0" || echo "$0")")
root=$(dirname "$here")
builddir=build
[ -z "${DEBUG:-}" ] || set -x
cd "$root"
[ -d "$builddir" ] || mkdir "$builddir"
poetry export --output="$builddir"/requirements.txt
$DOCKER_BIN build --tag webclip .

12
scripts/run Executable file
View file

@ -0,0 +1,12 @@
#!/bin/sh -eu
: "${DOCKER_BIN:=docker}"
[ -z "${DEBUG:-}" ] || set -x
exec $DOCKER_BIN run \
--rm -it \
--env UVICORN_HOST=0.0.0.0 \
--publish 8000:8000 \
webclip \
"$@"

10
scripts/server Executable file
View file

@ -0,0 +1,10 @@
#!/bin/sh -eu
[ -z "${DEBUG:-}" ] || set -x
# --reload \
# exec poetry run uvicorn \
exec uvicorn \
--no-server-header \
--no-date-header \
webclip:app