mirror of
https://github.com/johndoe6345789/snippet-pastebin.git
synced 2026-04-25 05:55:00 +00:00
1.5 KiB
1.5 KiB
Docker Compose Examples
This directory contains example Docker Compose configurations for different deployment scenarios.
Files
docker-compose.yml- Default full stack with auto-configured backenddocker-compose.backend-only.yml- Backend service onlydocker-compose.dev.yml- Development setup with hot reload
Usage
Full Stack (Frontend + Backend)
docker-compose up -d
Access:
- Frontend: http://localhost:3000
- Backend API: http://localhost:5000
Backend Only
docker-compose -f docker-compose.backend-only.yml up -d
Access:
- Backend API: http://localhost:5000
Then run frontend locally:
npm run dev
Configure frontend manually in Settings to use http://localhost:5000.
Development Mode
docker-compose -f docker-compose.dev.yml up -d
This runs:
- Backend in Docker
- Frontend expects you to run
npm run devlocally with env var set
Environment Variables
All configurations support these environment variables:
Backend
DB_PATH- SQLite database path (default:/data/snippets.db)
Frontend
VITE_FLASK_BACKEND_URL- Flask backend URL (enables auto-configuration)
Persistence
All configurations use a Docker volume snippet-data for persistent storage.
To backup:
docker run --rm -v codesnippet_snippet-data:/data -v $(pwd):/backup alpine tar czf /backup/snippets-backup.tar.gz /data
To restore:
docker run --rm -v codesnippet_snippet-data:/data -v $(pwd):/backup alpine tar xzf /backup/snippets-backup.tar.gz -C /