Add development scripts and Docker Compose configuration for local environment setup

- Introduced `dev-start.sh`, `dev-stop.sh`, `dev-logs.sh`, and `dev-shell.sh` for managing the development environment.
- Added `docker-compose.dev.yml` to define services for API and web applications with appropriate configurations.
- Updated `README.md` to include instructions for development mode and commands for managing the environment.
This commit is contained in:
salirezav
2025-09-11 14:24:21 -04:00
parent 5bdb070173
commit 8e7b5b054f
7 changed files with 373 additions and 1 deletions

View File

@@ -7,7 +7,9 @@ A unified monorepo combining the camera API service and the web dashboard for US
- `camera-management-api/` - Python API service for camera management (USDA-Vision-Cameras)
- `management-dashboard-web-app/` - React web dashboard for experiment management (pecan_experiments)
## Quick Start (Docker Compose)
## Quick Start
### Production Mode (Docker Compose)
1) Copy env template and set values (for web/Supabase):
@@ -28,6 +30,48 @@ docker compose up --build
To stop: `docker compose down`
### Development Mode (Recommended for Development)
For development with live logging, debugging, and hot reloading:
1) Copy env template and set values (for web/Supabase):
```bash
cp .env.example .env
# set VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY in .env
```
2) Start the development environment:
```bash
./dev-start.sh
```
This will:
- Start containers with debug logging enabled
- Enable hot reloading for both API and web services
- Show all logs in real-time
- Keep containers running for debugging
**Development URLs:**
- Web: <http://localhost:8080> (with hot reloading)
- API: <http://localhost:8000> (with debug logging)
**Development Commands:**
- `./dev-start.sh` - Start development environment
- `./dev-stop.sh` - Stop development environment
- `./dev-logs.sh` - View logs (use `-f` to follow, `-t N` for last N lines)
- `./dev-logs.sh -f api` - Follow API logs only
- `./dev-logs.sh -f web` - Follow web logs only
- `./dev-shell.sh` - Open shell in API container
- `./dev-shell.sh web` - Open shell in web container
**Debug Features:**
- API runs with `--debug --verbose` flags for maximum logging
- Web runs with Vite dev server for hot reloading
- All containers have `stdin_open: true` and `tty: true` for debugging
- Environment variables set for development mode
## Services
### API Service (Port 8000)