diff --git a/README.md b/README.md index 814d5ba..f249c7a 100644 --- a/README.md +++ b/README.md @@ -87,16 +87,13 @@ cd nlcc-itinerary - Configure email settings (required for password resets) - Optionally set `ADMIN_USERNAME` and `ADMIN_PASSWORD` (otherwise auto-generated) -3. Create the external Docker volume for data persistence: -```bash -docker volume create nlcc-data -``` - -4. Build and run with Docker Compose: +3. Build and run with Docker Compose: ```bash docker-compose up -d --build ``` +The Docker volume will be automatically created as `nlcc-itinerary_data`. + The application will be available at `http://localhost:3002` (or your configured port) **Important**: The `SITE_URL` must be set correctly for QR codes to work. This should be the public URL where your application is accessible (e.g., `https://church.example.com`). @@ -315,28 +312,26 @@ docker exec -it nlcc-itinerary sh ## Data Persistence -The SQLite database is stored in a Docker named volume (`nlcc-data`) which is mounted to `/app/data` in the container. This ensures: +The SQLite database is stored in a Docker named volume (`nlcc-itinerary_data`) which is mounted to `/app/data` in the container. This ensures: - Data persists across container restarts and rebuilds - Better portability across different environments - Easier backup and restore operations - Managed by Docker volume system +- Automatic creation on first `docker-compose up` **Volume Management Commands**: ```bash -# Create the volume (required before first run) -docker volume create nlcc-data - # Inspect volume location and details -docker volume inspect nlcc-data +docker volume inspect nlcc-itinerary_data # Backup the database -docker run --rm -v nlcc-data:/data -v $(pwd):/backup alpine tar czf /backup/nlcc-backup.tar.gz -C /data . +docker run --rm -v nlcc-itinerary_data:/data -v $(pwd):/backup alpine tar czf /backup/nlcc-backup.tar.gz -C /data . # Restore from backup -docker run --rm -v nlcc-data:/data -v $(pwd):/backup alpine tar xzf /backup/nlcc-backup.tar.gz -C /data +docker run --rm -v nlcc-itinerary_data:/data -v $(pwd):/backup alpine tar xzf /backup/nlcc-backup.tar.gz -C /data # Remove volume (WARNING: deletes all data!) -docker volume rm nlcc-data +docker volume rm nlcc-itinerary_data ``` ## License diff --git a/docker-compose.yml b/docker-compose.yml index 556e42f..ab35605 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: ports: - "3002:3000" volumes: - - nlcc-data:/app/data + - data:/app/data environment: - NODE_ENV=production - SITE_URL=https://church.example.com @@ -22,5 +22,4 @@ services: restart: unless-stopped volumes: - nlcc-data: - external: true + data: