docs: add Docker volume setup instructions to README
- Add production volume creation commands (slc_postgres_prod_data, slc_logs_prod) - Document volume purposes and file paths - Add production log access commands - Fix Quick Start section numbering
This commit is contained in:
34
README.md
34
README.md
@@ -125,7 +125,25 @@ Web application (PWA) enabling dance event participants to:
|
|||||||
### Prerequisites
|
### Prerequisites
|
||||||
- Docker and Docker Compose
|
- Docker and Docker Compose
|
||||||
|
|
||||||
### 1. Start the application
|
### 1. Setup production volumes (one-time setup)
|
||||||
|
|
||||||
|
Production environment requires persistent external Docker volumes for database and logs:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Create production database volume
|
||||||
|
docker volume create slc_postgres_prod_data
|
||||||
|
|
||||||
|
# Create production logs volume
|
||||||
|
docker volume create slc_logs_prod
|
||||||
|
```
|
||||||
|
|
||||||
|
These volumes persist data across container restarts and are used by:
|
||||||
|
- `slc_postgres_prod_data` - PostgreSQL database files
|
||||||
|
- `slc_logs_prod` - Application and nginx logs (accessible at `/var/log/app/` and `/var/log/nginx-app/`)
|
||||||
|
|
||||||
|
**Note:** Development profile uses auto-created volumes (no manual setup needed).
|
||||||
|
|
||||||
|
### 2. Start the application
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Clone repository
|
# Clone repository
|
||||||
@@ -138,11 +156,15 @@ cp backend/.env.example backend/.env
|
|||||||
# Start development mode
|
# Start development mode
|
||||||
docker compose --profile dev up
|
docker compose --profile dev up
|
||||||
|
|
||||||
|
# Start production mode (requires volumes from step 1)
|
||||||
|
docker compose --profile prod up
|
||||||
|
|
||||||
# Open browser
|
# Open browser
|
||||||
http://localhost:8080
|
http://localhost:8080 # Development
|
||||||
|
http://localhost # Production
|
||||||
```
|
```
|
||||||
|
|
||||||
### 2. Seed the database
|
### 3. Seed the database
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Seed with development data (includes test users, events, heats)
|
# Seed with development data (includes test users, events, heats)
|
||||||
@@ -152,7 +174,7 @@ make seed-dev
|
|||||||
docker compose exec backend npm run prisma:seed:dev
|
docker compose exec backend npm run prisma:seed:dev
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Test the application
|
### 4. Test the application
|
||||||
|
|
||||||
Use seeded accounts:
|
Use seeded accounts:
|
||||||
- **Admin:** admin@spotlight.cam / [password set during seed]
|
- **Admin:** admin@spotlight.cam / [password set during seed]
|
||||||
@@ -192,6 +214,10 @@ docker compose exec backend npm test -- matching-algorithm.test.js
|
|||||||
# Admin CLI
|
# Admin CLI
|
||||||
make dev-cli # Interactive REPL
|
make dev-cli # Interactive REPL
|
||||||
docker compose exec backend npm run cli -- users:list --limit 20
|
docker compose exec backend npm run cli -- users:list --limit 20
|
||||||
|
|
||||||
|
# Production logs (persistent across restarts)
|
||||||
|
docker exec slc-backend-prod tail -f /var/log/app/backend.log
|
||||||
|
docker exec slc-proxy-prod tail -f /var/log/nginx-app/nginx.log
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
Reference in New Issue
Block a user