chore: environnement dev local (hot reload backend + frontend)
This commit is contained in:
@@ -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 "$@"
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user