diff --git a/dev.sh b/dev.sh new file mode 100755 index 0000000..c4eb0de --- /dev/null +++ b/dev.sh @@ -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 "$@" diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml new file mode 100644 index 0000000..186c70a --- /dev/null +++ b/docker-compose.dev.yml @@ -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