diff --git a/Dockerfile.standalone b/Dockerfile.standalone index 0e452ff..ff9ebaa 100644 --- a/Dockerfile.standalone +++ b/Dockerfile.standalone @@ -55,6 +55,9 @@ RUN arduino-cli config init \ WORKDIR /app +# Data directory for persistent SQLite database (mounted as a volume at runtime) +RUN mkdir -p /app/data + # Install Python backend dependencies COPY backend/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index f260d72..f43f71f 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -7,6 +7,10 @@ services: restart: unless-stopped ports: - "3080:80" + environment: + - DATABASE_URL=sqlite+aiosqlite:////app/data/velxio.db + volumes: + - ./data:/app/data healthcheck: test: ["CMD", "curl", "-f", "http://localhost/health"] interval: 30s diff --git a/docker-compose.yml b/docker-compose.yml index ce624d1..643069e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,10 @@ services: ports: - "8001:8001" restart: unless-stopped + environment: + - DATABASE_URL=sqlite+aiosqlite:////app/data/velxio.db + volumes: + - ./data:/app/data healthcheck: test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8001/health')"] interval: 30s