chore: environnement dev local (hot reload backend + frontend)

This commit is contained in:
2026-05-24 05:23:53 +02:00
parent 0903115687
commit 99b9f1641e
2 changed files with 43 additions and 0 deletions
Executable
+11
View File
@@ -0,0 +1,11 @@
#!/bin/bash
set -e
echo "=== HomeHub Dev ==="
if [ ! -f .env ]; then
cp .env.example .env
echo "✓ .env créé depuis .env.example"
fi
docker compose -f docker-compose.yml -f docker-compose.dev.yml up "$@"
+32
View File
@@ -0,0 +1,32 @@
services:
db:
ports:
- "5432:5432"
backend:
build:
context: ./backend
volumes:
- ./backend:/app
- uploads:/uploads
environment:
DATABASE_URL: postgresql+asyncpg://homehub:homehub@db:5432/homehub
UPLOAD_DIR: /uploads
CORS_ORIGINS: http://localhost:3000
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
ports:
- "8000:8000"
frontend:
image: node:20-alpine
working_dir: /app
volumes:
- ./frontend:/app
- /app/node_modules
environment:
VITE_API_URL: http://localhost:8000
command: sh -c "npm install && npm run dev -- --host 0.0.0.0"
ports:
- "3000:5173"
depends_on:
- backend