feat: deploy a production level webserver with docker

Refs: OPS-15
This commit is contained in:
Christoph J. Scherr 2025-03-23 14:48:24 +01:00
parent 8cd216673c
commit 2c75fa26a7
No known key found for this signature in database
GPG key ID: 9EB784BB202BB7BB
4 changed files with 3 additions and 4 deletions

View file

@ -14,8 +14,6 @@ RUN apk add curl bash jq
RUN pip install poetry
RUN poetry install
FROM base as dev
# Expose development port
EXPOSE 5000

View file

@ -2,7 +2,6 @@ services:
senju:
build:
context: .
target: dev
ports:
- "127.0.0.1:5000:5000"
volumes:

View file

@ -1,4 +1,5 @@
#!/bin/bash
set -e
# First create a readable multiline string
SYSTEM_PROMPT=$(cat <<EOF
@ -65,4 +66,4 @@ CONF=$(jq -n --arg system "$SYSTEM_PROMPT" '{
curl http://ollama:11434/api/pull -d '{"model": "phi3"}'
curl http://ollama:11434/api/create -d "$CONF"
cd /app
poetry run sh -c 'flask --app senju/main run --host=0.0.0.0'
poetry run sh -c 'waitress-serve --listen=*:5000 senju.main:app'

View file

@ -13,6 +13,7 @@ dependencies = [
"requests (>=2.32.3,<3.0.0)",
"coverage (>=7.6.12,<8.0.0)",
"pytest-httpserver (>=1.1.2,<2.0.0)",
"waitress (>=3.0.2,<4.0.0)",
]