The deployment script (deploy.sh
) automates the setup and maintenance of your Foxhole application deployment, handling everything from Docker installation to SSL certificate management.
- Root access on the deployment server
- Git installed
- Domain name pointing to your server
- Valid email address for SSL certificates
./deploy.sh [domain] [email] [options]
domain
: Your domain name (e.g., example.com)email
: Email address for SSL certificate notifications
--help, -h
: Show help message--docker
: Install Docker and Docker Compose--fetch-code
: Pull latest code from git repository, update git repository before deployment (restores and pulls)--setup-ssl
: Setup/renew SSL certificates--force-ssl
: Force SSL certificate renewal
- First-time deployment:
sudo ./deploy.sh example.com [email protected] --docker --setup-ssl
- Update deployment with latest code:
sudo ./deploy.sh example.com [email protected] --fetch-code
- Renew SSL certificates:
sudo ./deploy.sh example.com [email protected] --setup-ssl --force-ssl
-
Docker Environment
- Installs Docker and Docker Compose if needed
- Sets up proper permissions
-
Application
- Creates necessary directories
- Sets up environment variables
- Builds and starts application containers
-
SSL Certificates
- Generates SSL certificates using Let's Encrypt
- Configures automatic renewal
- Sets up Nginx with SSL
-
Data Persistence
- Creates data directories for DB, MinIO, and Redis
- Sets appropriate permissions
- Ensures proper volume mounting
/
├── data/
│ ├── db/
│ ├── minio/
│ └── redis/
├── certbot/
│ ├── conf/
│ └── www/
└── nginx.conf
- View logs:
docker-compose logs -f
- Restart services:
docker-compose restart
- Stop services:
docker-compose down
- Start services:
docker-compose up -d
-
SSL Certificate Issues
- Check certbot logs:
docker-compose logs certbot
- Force renew: Use
--force-ssl
option
- Check certbot logs:
-
Application Issues
- Check application logs:
docker-compose logs app
- Verify
.env
configuration - Check data directory permissions
- Check application logs:
-
Nginx Issues
- Check nginx logs:
docker-compose logs nginx
- Verify nginx.conf configuration
- Check nginx logs:
- Always backup data before major updates
- Keep track of SSL certificate expiration dates
- Monitor disk space usage in data directories
- Regular updates recommended for security