fix docker compose

This commit is contained in:
2025-09-17 09:16:46 +03:00
parent 58e69ba69e
commit cd1b3db6ec
2 changed files with 6 additions and 4 deletions

View File

@@ -23,7 +23,7 @@ services:
expose: expose:
- "5001" - "5001"
networks: networks:
- reverse-proxy_default - reverse-proxy
healthcheck: healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:5001/healthz"] test: ["CMD", "curl", "-fsS", "http://localhost:5001/healthz"]
interval: 30s interval: 30s
@@ -54,7 +54,7 @@ services:
depends_on: depends_on:
- solardb-api - solardb-api
networks: networks:
- reverse-proxy_default - reverse-proxy
healthcheck: healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:5000/"] test: ["CMD", "curl", "-fsS", "http://localhost:5000/"]
interval: 30s interval: 30s
@@ -66,5 +66,5 @@ volumes:
solardb_uploads: solardb_uploads:
networks: networks:
reverse-proxy_default: reverse-proxy:
external: true external: true

View File

@@ -2,11 +2,13 @@ from flask import Flask, request, jsonify
from tinydb import TinyDB, Query, where from tinydb import TinyDB, Query, where
from tinydb.operations import set as ops_set from tinydb.operations import set as ops_set
import json import json
import os
app = Flask(__name__) app = Flask(__name__)
# Single TinyDB file for now (can be swapped to per-table later) # Single TinyDB file for now (can be swapped to per-table later)
db = TinyDB("db.json") DB_PATH = os.getenv("DB_PATH", "db.json")
db = TinyDB(DB_PATH)
# --- Helpers ----------------------------------------------------------------- # --- Helpers -----------------------------------------------------------------