Prod/Dev mode
This commit is contained in:
65
README.md
65
README.md
@@ -68,9 +68,13 @@ membership/
|
||||
- SMTP2GO API key (for email notifications)
|
||||
- Database password (if desired)
|
||||
|
||||
3. **Start the services**:
|
||||
3. **Start the services in your preferred mode**:
|
||||
```bash
|
||||
docker-compose up -d
|
||||
# For development (with hot reloading)
|
||||
docker-compose --profile dev up -d
|
||||
|
||||
# For production (optimized static files)
|
||||
docker-compose --profile prod up -d
|
||||
```
|
||||
|
||||
4. **Wait for services to be ready** (about 30 seconds for MySQL initialization):
|
||||
@@ -79,10 +83,63 @@ membership/
|
||||
```
|
||||
Press Ctrl+C when you see "Application startup complete"
|
||||
|
||||
5. **Access the API**:
|
||||
5. **Access the application**:
|
||||
- Frontend: http://localhost:3500 (development) or http://localhost:8080 (production)
|
||||
- API: http://localhost:8000
|
||||
- API Documentation: http://localhost:8000/docs
|
||||
- Alternative Docs: http://localhost:8000/redoc
|
||||
|
||||
## Frontend Development vs Production
|
||||
|
||||
The frontend supports both development and production modes using Docker Compose profiles:
|
||||
|
||||
### Development Mode (Vite)
|
||||
- Hot reloading and development features
|
||||
- Access at: http://localhost:3500
|
||||
- Start with: `docker-compose --profile dev up -d`
|
||||
|
||||
### Production Mode (Nginx)
|
||||
- Optimized static files served by Nginx
|
||||
- Access at: http://localhost:8080
|
||||
- Start with: `docker-compose --profile prod up -d`
|
||||
|
||||
### Usage Examples
|
||||
|
||||
```bash
|
||||
# Start all services in development mode
|
||||
docker-compose --profile dev up -d
|
||||
|
||||
# Start all services in production mode
|
||||
docker-compose --profile prod up -d
|
||||
|
||||
# Start only the frontend in development mode
|
||||
docker-compose --profile dev up -d frontend
|
||||
|
||||
# Start only the frontend in production mode
|
||||
docker-compose --profile prod up -d frontend-prod
|
||||
|
||||
# Stop all services
|
||||
docker-compose down
|
||||
|
||||
# Check which services are running
|
||||
docker-compose ps
|
||||
```
|
||||
|
||||
### Profile Details
|
||||
|
||||
- **`dev` profile**: Includes the `frontend` service (Vite dev server)
|
||||
- **`prod` profile**: Includes the `frontend-prod` service (Nginx)
|
||||
- **Default**: No frontend service runs unless you specify a profile
|
||||
|
||||
### For Production Deployment
|
||||
|
||||
When deploying to production with Caddy:
|
||||
|
||||
1. Start services in production mode:
|
||||
```bash
|
||||
docker-compose --profile prod up -d
|
||||
```
|
||||
|
||||
2. Configure Caddy to proxy to `localhost:8080` for the frontend and `localhost:6000` for the API
|
||||
|
||||
## Default Credentials
|
||||
|
||||
|
||||
Reference in New Issue
Block a user