mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-17 13:55:08 +00:00
Docker environment for developing, deploying, and running Frappe applications (ERPNext and custom apps) in production and development
| .github | ||
| .ssh | ||
| .vscode | ||
| images/custom | ||
| nginx | ||
| resources | ||
| scripts | ||
| .dockerignore | ||
| .editorconfig | ||
| .env.example | ||
| .gitignore | ||
| compose.yaml | ||
| DEPLOYMENT.md | ||
| docker-bake.hcl | ||
| LICENSE | ||
| LOCAL_TESTING.md | ||
| README.md | ||
| setup.cfg | ||
Academy Docker - Automated Deployment for Academy LMS Stack
This repository provides an automated deployment solution for the Academy LMS stack on Hetzner Cloud. It monitors changes in the application repositories and automatically builds, pushes, and deploys updated Docker images.
🎯 Purpose
This is a fork of frappe/frappe_docker customized to:
- Automatically deploy the Academy LMS stack with custom Frappe apps
- Monitor and react to changes in watched repositories
- Provide CI/CD pipeline for Hetzner deployment
- Integrate AI-powered tutoring capabilities via LangChain
📦 Components
The stack includes:
- Academy LMS - Custom fork of Frappe LMS
- Academy AI Tutor Chat - AI-powered tutoring Frappe app
- Academy LangChain - LangChain service for AI functionality
- Frappe Framework - The underlying framework
- Supporting Services - MariaDB, Redis, PostgreSQL, Nginx
🚀 I. Quick Start (Local)
Prerequisites
- GitHub account with access to all repositories
- Git and Docker on you machine
Basic Setup
- Use WSL or Linux
- Clone this repository
- run the next command in terminal:
git clone https://github.com/ExarLabs/academy_docker.git
- run the next command in terminal:
- Create
.envfile in the root folder (check.env.examplefor inspiration)- run the next command in terminal:
cp .env.example .env - edit the
.envfile as you want. Note that if you change theLANGCHAIN_DB_PASSWORDenv variable, you must also change it in the langchain repository's .env file
- run the next command in terminal:
- Run
docker compose up -d - Create a site by running
bash ./scripts/create-site.sh <your_site_name>- your site name must be a valid domain like name (for example academy.local, exar.labs) or an ip (like: 113.23.244.114)
- Set your site name in your machine's hosts file
- add the following line to your machine's hosts file
127.0.0.1 <your_site_name> - hosts file location on mac / linus:
/etc/hosts/ - hosts file location on windows:
C:\Windows\System32\drivers\etc\hosts
- add the following line to your machine's hosts file
- Type <your_site_name> in your browser
🚀 II. Quick Start (CI/CD)
For detailed deployment instructions, see DEPLOYMENT.md.
Prerequisites
- GitHub account with access to all repositories
- Hetzner server (Ubuntu 20.04+ recommended)
- GitHub Personal Access Token
- OpenAI API key (for AI features)
Basic Setup
- Fork this repository
- Configure GitHub secrets:
HETZNER_SSH_KEYACADEMY_DOCKER_PAT
- Add webhook workflows to watched repositories
- Run setup script on Hetzner server
- Configure environment variables
- Trigger initial deployment
🔄 Automated Workflow
graph LR
A[Code Push] --> B[Webhook Trigger]
B --> C[Build Docker Image]
C --> D[Push to GHCR]
D --> E[Deploy to Hetzner]
E --> F[Run Migrations]
F --> G[Health Check]
📁 Repository Structure
academy_docker/
├── .github/workflows/ # CI/CD workflows
│ ├── deploy.yml # Main deployment workflow
│ └── webhook-*.yml # Webhook templates for watched repos
├── images/ # Docker image definitions
│ └── custom/ # Custom Frappe image with apps
├── nginx/ # Nginx configuration
├── scripts/ # Utility scripts
│ ├── migrate-all-sites.sh
│ └── setup-hetzner.sh
├── compose.yaml # Docker Compose configuration
├── .env.example # Environment variables template
└── DEPLOYMENT.md # Detailed deployment guide
🔧 Configuration
Key environment variables:
MARIADB_ROOT_PASSWORD- Database root passwordADMIN_PASSWORD- Frappe admin passwordOPENAI_API_KEY- OpenAI API key for AI featuresFRAPPE_SITE_NAME_HEADER- Your domain nameLANGCHAIN_API_URL- LangChain service URL
🛡️ Security
- All secrets stored in GitHub Secrets
- Firewall rules configured automatically
- SSL/TLS support for production
- Regular automated backups
📊 Monitoring
- Check service status:
docker compose ps - View logs:
docker compose logs -f - System health:
docker compose exec backend bench doctor
Setup HTTPS for new domains / subdomains
- SSL/TSL security protol is handled by installign
certbotandnginx. - SSL/TSL certificate is generated and handled by
certbot. Auto-renewing is enabled by a cronjob - some nginx configuration (proxying) is create at
/etc/nginx/sites-available/ignis.academy
Steps
- update the
/etc/nginx/sites-available/ignis.academyfile by adding the new (sub-)domain to theserver_namefields - run the following command:
sudo certbot --nginx -d already.added.domain1 -d already.added.domain2 ... -d new.domain3
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Submit a pull request
📝 License
This project inherits the license from the original frappe_docker repository.
🆘 Support
- Check DEPLOYMENT.md for detailed instructions
- Review GitHub Actions logs for deployment issues
- Open an issue for bugs or feature requests
Built with ❤️ for automated Academy LMS deployment