Skip to content

Instantly share code, notes, and snippets.

@revant
Last active June 11, 2025 14:53
Show Gist options
  • Select an option

  • Save revant/010c058f7c485cc62f2cc4d604ab8511 to your computer and use it in GitHub Desktop.

Select an option

Save revant/010c058f7c485cc62f2cc4d604ab8511 to your computer and use it in GitHub Desktop.

Revisions

  1. revant revised this gist Sep 4, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -73,3 +73,4 @@ docker exec --user root -e "TERM=xterm-256color" -w /workspace/development -d be
    Notes:
    - publish port 80 in bench/docker-compose.yml
    - Add volumes for `/etc/nginx/conf.d/` and `/etc/supervisor/conf.d/`
    - default frappe/bench:latest image does not have supervisor and nginx installed. Either install or build new image with frappe/bench as base image
  2. revant created this gist Mar 20, 2021.
    75 changes: 75 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,75 @@
    # Install frappe-bench using docker

    Clone frappe_docker

    ```shell
    git clone https://github.com/frappe/frappe_docker.git
    cd frappe_docker
    ```

    # Install bench using docker

    ```shell
    cp -R devcontainer-example bench
    docker-compose -f bench/docker-compose.yml up -d
    ```

    # Exec into the container

    ```shell
    docker exec -e "TERM=xterm-256color" -w /workspace/development -it bench_frappe_1 bash
    ```

    # Install Frappe Framework and ERPNext

    ```shell
    # Install bench for root
    supo pip3 install -e /home/frappe/.bench

    # Create frappe-bench
    bench init --skip-redis-config-generation --frappe-branch version-12 frappe-bench
    cd frappe-bench

    # Set docker specific hosts
    bench set-mariadb-host mariadb
    bench set-redis-cache-host redis-cache:6379
    bench set-redis-queue-host redis-queue:6379
    bench set-redis-socketio-host redis-socketio:6379

    # Get ERPNext
    bench get-app --branch version-12 erpnext

    # Create new site
    bench new-site myerp.mysite.com --mariadb-root-password 123 --admin-password admin --no-mariadb-socket

    # Install ERPNext on site
    bench --site myerp.mysite.com install-app erpnext

    # Setup supervisor (includes nginx)
    bench setup supervisor --skip-redis

    # Symlink or copy supervisor and nginx configs
    sudo ln -s `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf
    sudo ln -s `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf
    # Or copy supervisor and nginx configs
    sudo cp `pwd`/config/nginx.conf /etc/nginx/conf.d/frappe.conf
    sudo cp `pwd`/config/supervisor.conf /etc/supervisor/conf.d/frappe.conf

    # exit container
    ```

    # Start supervisord

    ```shell
    docker exec --user root -e "TERM=xterm-256color" -w /workspace/development -d bench_frappe_1 supervisord
    ```

    # Stop supervisord

    ```shell
    docker exec --user root -e "TERM=xterm-256color" -w /workspace/development -d bench_frappe_1 supervisorctl stop all
    ```

    Notes:
    - publish port 80 in bench/docker-compose.yml
    - Add volumes for `/etc/nginx/conf.d/` and `/etc/supervisor/conf.d/`