- Update docker-compose.yml to include VAPID environment variables - Create DOCKER_PUSH_NOTIFICATIONS_SETUP.md with Docker-specific instructions - Create PUSH_NOTIFICATIONS_DOCKER_CHECKLIST.md for easy setup tracking - Update .env.example with Docker command for generating VAPID keys Setup for Docker: 1. Generate VAPID keys (npx web-push generate-vapid-keys) 2. Add keys to .env file 3. Run: docker-compose exec app npx prisma db push 4. Rebuild: docker-compose up --build The web-push package is automatically installed during docker build. All notification functionality works the same in Docker as locally.
1.5 KiB
1.5 KiB
Push Notifications Docker Setup Checklist
✅ What's Already Done
- Code implementation complete
- Docker configuration updated
- Environment variables added to docker-compose.yml
- Dependencies added to package.json (will install on build)
🔧 What You Need to Do
[ ] 1. Generate VAPID Keys
Run this command:
npx web-push generate-vapid-keys
Or if you don't have Node locally:
docker run --rm -it node:20-slim sh -c "npm install -g web-push && web-push generate-vapid-keys"
[ ] 2. Add Keys to .env
Copy the output and add to your .env file:
VAPID_PUBLIC_KEY=BNxxx...
VAPID_PRIVATE_KEY=xxx...
VAPID_SUBJECT=mailto:your-email@example.com
[ ] 3. Update Database
Start containers and run migration:
docker-compose up -d
docker-compose exec app npx prisma db push
[ ] 4. Rebuild Containers
docker-compose down
docker-compose up --build
✅ Verify It Works
- Open http://localhost:3500
- Log in
- Wait 3 seconds
- See notification prompt appear
- Click "Enable Notifications"
- Test by adding items from another browser
🎉 Done!
Once you complete these 4 steps, push notifications will work automatically!
Quick Reference
Check if VAPID keys are loaded:
docker-compose exec app env | grep VAPID
Check database tables:
docker-compose exec app npx prisma studio
View logs:
docker-compose logs -f app
Restart after .env changes:
docker-compose restart