This guide will get your Grocery application running in production in under 15 minutes.
- Linux server with Docker and Docker Compose installed
- Domain name pointing to your server
- Ports 80 and 443 open
git clone <repository-url> /opt/grocery
cd /opt/grocery# Copy the environment template
cp .env.prod.template .env.prod
# Generate secrets
JWT_ACCESS=$(openssl rand -base64 32)
JWT_REFRESH=$(openssl rand -base64 32)
ZERO_SECRET=$(openssl rand -base64 32)
DB_PASSWORD=$(openssl rand -base64 32)
# Edit .env.prod
nano .env.prodRequired changes in .env.prod:
DOMAIN=your-domain.com
CERTBOT_EMAIL=your-email@example.com
DB_PASSWORD=<paste-generated-password>
JWT_ACCESS_SECRET=<paste-generated-secret>
JWT_REFRESH_SECRET=<paste-generated-secret>
ZERO_AUTH_SECRET=<paste-generated-secret>
CORS_ORIGIN=https://your-domain.com
VITE_API_URL=https://your-domain.com/api
VITE_ZERO_SERVER=wss://your-domain.com/zerochmod 600 .env.prod
chmod +x deploy.sh# Start base services first
./deploy.sh start --sslWait for all services to be healthy (about 30 seconds).
./deploy.sh ssl-cert --sslThis will:
- Contact Let's Encrypt
- Verify domain ownership
- Install SSL certificate
- Restart nginx
# Check all services are healthy
./deploy.sh health --ssl
# View logs
./deploy.sh logs --ssl | tail -50
# Test the application
curl https://your-domain.com/healthOpen your browser and navigate to https://your-domain.com
./deploy.sh backup-dbYour application is now running in production with:
- ✅ SSL/TLS encryption
- ✅ Automatic certificate renewal
- ✅ All services containerized
- ✅ Health monitoring
- ✅ Resource limits
- ✅ Security hardening
- Set up automated backups (add to cron)
- Configure monitoring
- Review logs regularly
- Test all features
- Run SSL Labs test: https://www.ssllabs.com/ssltest/
# View logs
./deploy.sh logs -f --ssl
# Restart all services
./deploy.sh restart --ssl
# Stop all services
./deploy.sh stop
# Backup database
./deploy.sh backup-db
# Update application
./deploy.sh update --ssl
# Check health
./deploy.sh health --ssl# Check logs
./deploy.sh logs --ssl
# Check service status
./deploy.sh status- Verify domain DNS is pointing to server
- Check ports 80 and 443 are open
- Wait for DNS propagation (24-48 hours)
# Check database logs
docker logs grocery-postgres-prod
# Restart database
docker restart grocery-postgres-prod- Check SSL_DEPLOYMENT.md for detailed SSL setup
- Check DEPLOYMENT_CHECKLIST.md for complete checklist
- Check DOCKER_DEPLOYMENT_SUMMARY.md for architecture details
- Never commit .env.prod to version control
- Use strong, unique passwords for all secrets
- Keep Docker and system packages updated
- Enable firewall and fail2ban
- Regularly backup your database
- Monitor logs for suspicious activity
For issues or questions:
- Check the logs:
./deploy.sh logs --ssl - Review documentation in this repository
- Check Docker and nginx documentation