Docker environment for developing, deploying, and running Frappe applications (ERPNext and custom apps) in production and development
Find a file
2026-01-08 15:51:10 +02:00
.github default env is test 2025-07-18 13:42:09 +03:00
.ssh KAN-63: remove unnused files 2025-06-27 18:12:28 +03:00
.vscode chore(lint): Run prettier 2021-12-10 11:53:43 +03:00
images/custom KAN-63: remove unnused files 2025-06-27 18:12:28 +03:00
nginx missing files added v2 2025-07-14 15:49:06 +03:00
resources missing files added 2025-07-14 15:19:34 +03:00
scripts now the script wont exit on missing sites case 2026-01-08 15:51:10 +02:00
.dockerignore Global refactoring (#617) 2022-03-14 11:23:03 +05:30
.editorconfig chore: Use pre-commit framework (#604) 2021-12-10 11:48:00 +03:00
.env.example env example updated 2025-07-18 14:18:51 +03:00
.gitignore fix: gitignore (#1391) 2024-05-01 12:25:49 +05:30
compose.yaml the port of the FE app is changed 2025-07-21 11:54:08 +03:00
DEPLOYMENT.md KAN-63: fix deployment doc 2025-06-27 16:19:08 +03:00
docker-bake.hcl ci: push frappe or erpnext branch as tag (#1508) 2024-11-11 11:52:27 +05:30
LICENSE chore: Rename LICENSE.md to LICENSE (#608) 2021-12-10 16:25:57 +05:30
LOCAL_TESTING.md KAN-63: fix maria db user ip issue after rebuild 2025-06-27 14:19:58 +03:00
README.md readme updated 2025-07-21 12:41:39 +03:00
setup.cfg Use pytest (#705) 2022-03-24 10:40:56 +03:00

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:

  1. Academy LMS - Custom fork of Frappe LMS
  2. Academy AI Tutor Chat - AI-powered tutoring Frappe app
  3. Academy LangChain - LangChain service for AI functionality
  4. Frappe Framework - The underlying framework
  5. 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

  1. Use WSL or Linux
  2. Clone this repository
    • run the next command in terminal: git clone https://github.com/ExarLabs/academy_docker.git
  3. Create .env file in the root folder (check .env.example for inspiration)
    • run the next command in terminal: cp .env.example .env
    • edit the .env file as you want. Note that if you change the LANGCHAIN_DB_PASSWORD env variable, you must also change it in the langchain repository's .env file
  4. Run docker compose up -d
  5. 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)
  6. 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
  7. 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

  1. Fork this repository
  2. Configure GitHub secrets:
    • HETZNER_SSH_KEY
    • ACADEMY_DOCKER_PAT
  3. Add webhook workflows to watched repositories
  4. Run setup script on Hetzner server
  5. Configure environment variables
  6. 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 password
  • ADMIN_PASSWORD - Frappe admin password
  • OPENAI_API_KEY - OpenAI API key for AI features
  • FRAPPE_SITE_NAME_HEADER - Your domain name
  • LANGCHAIN_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 certbot and nginx.
  • 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

  1. update the /etc/nginx/sites-available/ignis.academy file by adding the new (sub-)domain to the server_name fields
  2. run the following command: sudo certbot --nginx -d already.added.domain1 -d already.added.domain2 ... -d new.domain3

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. 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