feat: compose stack in devcontainer (db, langflow, lfx)
- docker-compose.yml with app/db/langflow/lfx services and healthchecks - Dockerfile.lfx (stateless flow runtime on :6004) - init-db.sql (langflow + test databases) - devcontainer.json switched to compose mode with runServices - setup.sh waits for compose services and requires .env
This commit is contained in:
parent
86fe4424e7
commit
2ba062c4c5
6 changed files with 154 additions and 9 deletions
|
|
@ -13,6 +13,38 @@ echo "--- Installing Node dependencies ---"
|
|||
cd /workspaces/kirche-einfach/frontend
|
||||
npm install
|
||||
|
||||
# Compose services (db, langflow, lfx) must be up; fail loudly otherwise.
|
||||
echo "--- Waiting for compose services ---"
|
||||
if [ ! -f /workspaces/kirche-einfach/.env ]; then
|
||||
echo "ERROR: /workspaces/kirche-einfach/.env is missing. Copy .env.example to .env and fill in secrets." >&2
|
||||
exit 1
|
||||
fi
|
||||
python3 - <<'EOF'
|
||||
import socket
|
||||
import sys
|
||||
import time
|
||||
|
||||
targets = [("db", 5432), ("langflow", 7860), ("lfx", 6004)]
|
||||
deadline = time.time() + 180
|
||||
pending = dict(targets)
|
||||
while pending and time.time() < deadline:
|
||||
for host, port in list(pending):
|
||||
s = socket.socket()
|
||||
s.settimeout(2)
|
||||
try:
|
||||
s.connect((host, port))
|
||||
print(f"OK {host}:{port}", flush=True)
|
||||
del pending[(host, port)]
|
||||
except OSError:
|
||||
pass
|
||||
finally:
|
||||
s.close()
|
||||
if pending:
|
||||
time.sleep(2)
|
||||
if pending:
|
||||
sys.exit(f"ERROR: compose services not ready: {sorted(pending)}")
|
||||
EOF
|
||||
|
||||
echo ""
|
||||
echo "=== Setup complete ==="
|
||||
echo "Forgejo username: $FORGEJO_USERNAME"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue