159 lines
6.4 KiB
Markdown
159 lines
6.4 KiB
Markdown
[](https://github.com/frappe/frappe_docker/actions/workflows/build_stable.yml)
|
|
[](https://github.com/frappe/frappe_docker/actions/workflows/build_develop.yml)
|
|
|
|
Everything about [Frappe](https://github.com/frappe/frappe) and [ERPNext](https://github.com/frappe/erpnext) in containers.
|
|
|
|
# Getting Started
|
|
|
|
To get started you need [Docker](https://docs.docker.com/get-docker/), [docker-compose](https://docs.docker.com/compose/), and [git](https://docs.github.com/en/get-started/getting-started-with-git/set-up-git) setup on your machine. For Docker basics and best practices refer to Docker's [documentation](http://docs.docker.com).
|
|
After that, clone this repo:
|
|
|
|
```sh
|
|
git clone https://github.com/frappe/frappe_docker
|
|
cd frappe_docker
|
|
```
|
|
|
|
### Try in Play With Docker
|
|
|
|
<a href="https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/frappe/frappe_docker/main/pwd.yml">
|
|
<img src="https://raw.githubusercontent.com/play-with-docker/stacks/master/assets/images/button.png" alt="Try in PWD"/>
|
|
</a>
|
|
|
|
Wait for 5 minutes for ERPNext site to be created or check `create-site` container logs before opening browser on port 8080. (username: `Administrator`, password: `admin`)
|
|
|
|
# Documentation
|
|
|
|
### [Production](#production)
|
|
|
|
- [List of containers](docs/list-of-containers.md)
|
|
- [Single Compose Setup](docs/single-compose-setup.md)
|
|
- [Environment Variables](docs/environment-variables.md)
|
|
- [Single Server Example](docs/single-server-example.md)
|
|
- [Setup Options](docs/setup-options.md)
|
|
- [Site Operations](docs/site-operations.md)
|
|
- [Backup and Push Cron Job](docs/backup-and-push-cronjob.md)
|
|
- [Port Based Multi Tenancy](docs/port-based-multi-tenancy.md)
|
|
- [Migrate from multi-image setup](docs/migrate-from-multi-image-setup.md)
|
|
- [running on linux/mac](docs/setup_for_linux_mac.md)
|
|
|
|
### [Custom Images](#custom-images)
|
|
|
|
- [Custom Apps](docs/custom-apps.md)
|
|
- [Build Version 10 Images](docs/build-version-10-images.md)
|
|
|
|
### [Development](#development)
|
|
|
|
- [Development using containers](docs/development.md)
|
|
- [Bench Console and VSCode Debugger](docs/bench-console-and-vscode-debugger.md)
|
|
- [Connect to localhost services](docs/connect-to-localhost-services-from-containers-for-local-app-development.md)
|
|
|
|
### [Troubleshoot](docs/troubleshoot.md)
|
|
|
|
### Shiloh Setup
|
|
|
|
based on: https://raw.githubusercontent.com/frappe/bench/develop/easy-install.py
|
|
|
|
`git clone ssh://git@githaven.org:2222/Shiloh/frappe_docker.git`
|
|
|
|
sites = [erp.sprinklersnorthwest.com]
|
|
email = support@lasthourhosting.org
|
|
|
|
`cd frappe_docker`
|
|
`cp example.env .env`
|
|
|
|
Write inside of env:
|
|
|
|
<!-- Commented items because the script doesn't read them. -->
|
|
<!-- f"ERPNEXT_VERSION={erpnext_version}\n", -->
|
|
|
|
f"DB_PASSWORD={db_pass}\n",
|
|
|
|
<!-- "DB_HOST=db\n",
|
|
"DB_PORT=3306\n",
|
|
"REDIS_CACHE=redis-cache:6379\n",
|
|
"REDIS_QUEUE=redis-queue:6379\n",
|
|
"REDIS_SOCKETIO=redis-socketio:6379\n",
|
|
f"LETSENCRYPT_EMAIL={email}\n", -->
|
|
|
|
f"SITE_ADMIN_PASS={admin_pass}\n",
|
|
|
|
<!-- f"SITES={quoted_sites}\n", -->
|
|
|
|
<!-- from inside the frappe-docker repo: -->
|
|
|
|
<!-- Setup reference to our own erpnext repo -->
|
|
|
|
`APPS_JSON_BASE64=$(base64 -w 0 ./apps.json)`
|
|
|
|
<!-- build the docker image -->
|
|
|
|
`sudo docker build \
|
|
--build-arg=FRAPPE_PATH=https://github.com/frappe/frappe \
|
|
--build-arg=FRAPPE_BRANCH=version-15 \
|
|
--build-arg=PYTHON_VERSION=3.11.6 \
|
|
--build-arg=NODE_VERSION=18.18.2 \
|
|
--build-arg=APPS_JSON_BASE64=$APPS_JSON_BASE64 \
|
|
--tag=githaven.org/shiloh/frappe_docker:production \
|
|
--file=images/custom/Containerfile \
|
|
--rm \
|
|
--no-cache \
|
|
.`
|
|
|
|
<!-- Push to githaven -->
|
|
|
|
<!-- sudo docker image tag NAME:TAG githaven.org/shiloh/frappe_docker:production -->
|
|
|
|
`sudo docker login githaven.org`
|
|
setup credential service to hide password
|
|
`sudo docker push githaven.org/shiloh/frappe_docker:production`
|
|
https://docs.gitea.com/packages/packages/container
|
|
|
|
<!-- Install erpnext for first time -->
|
|
|
|
`sudo python3 easy-installer.py --prod --email support@lasthourhosting.org --site erp.sprinklersnorthwest.com`
|
|
|
|
`bench use` should already be done by the installer.
|
|
|
|
<!-- `sudo docker compose -p frappe exec backend bench use erp.sprinklersnorthwest.com` -->
|
|
|
|
Create a project through the dashboard with the sidebar, then login with the admin account and view the projects page through the other dashboard, you should see edits.
|
|
|
|
<!-- to enter the container: -->
|
|
|
|
`sudo docker compose -p frappe exec -it backend bash`
|
|
|
|
To update erpnext, add any commits you want to use to the "production" branch of the erpnext repo on githaven. Then ensure the "backend" container has git repositories in the frappe and erpnext apps:
|
|
`cd ~/frappe-bench/apps/erpnext`
|
|
`git init`
|
|
`git remote add upstream <repo>`
|
|
`git fetch upstream production`
|
|
`git checkout production --force`
|
|
`git clean -fd`
|
|
|
|
Then pull the latest erpnext, and it will be updated.
|
|
|
|
<!-- Bench update hangs on node esbuild, so we're just manually pulling the latest changes rather than doing it through this command. -->
|
|
<!-- Then from ./frappe-bench run:
|
|
`bench update` -->
|
|
|
|
<!-- `sudo docker compose --project-name brotherton -f compose.yaml -f overrides/compose.mariadb.yaml -f overrides/compose.redis.yaml -f overrides/compose.https.yaml --env-file .env config`
|
|
|
|
Make images/production/Containerfile available as a package on githaven? need to replace the erpnext repo argument inside it.
|
|
inside of compose.yaml, replace "image: frappe/erpnext" with the above package.
|
|
|
|
`. .env`
|
|
`sudo docker compose -p brotherton -f compose.yaml up -d`
|
|
|
|
The "erpnext" in this command is probably fine, I think the bench get-app inside the docker compose gets the erpnext repository and puts it into an erpnext "app", regardless of what the erpnext repo env variable is. This command only works if SITES contains a single site.
|
|
`sudo docker compose -p brotherton exec backend bench new-site "$SITES" --no-mariadb-socket --db-root-password "$DB_PASSWORD" --admin-password "$SITE_ADMIN_PASS" --install-app erpnext --set-default` -->
|
|
|
|
# Contributing
|
|
|
|
If you want to contribute to this repo refer to [CONTRIBUTING.md](CONTRIBUTING.md)
|
|
|
|
This repository is only for container related stuff. You also might want to contribute to:
|
|
|
|
- [Frappe framework](https://github.com/frappe/frappe#contributing),
|
|
- [ERPNext](https://github.com/frappe/erpnext#contributing),
|
|
- [Frappe Bench](https://github.com/frappe/bench).
|