mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-09-16 17:19:03 +00:00
chore(lint): Run prettier
This commit is contained in:
parent
8b4dfce4f0
commit
fb07581595
8
.vscode/extensions.json
vendored
8
.vscode/extensions.json
vendored
@ -3,11 +3,7 @@
|
||||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
||||
|
||||
// List of extensions which should be recommended for users of this workspace.
|
||||
"recommendations": [
|
||||
"ms-vscode-remote.remote-containers"
|
||||
],
|
||||
"recommendations": ["ms-vscode-remote.remote-containers"],
|
||||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||
"unwantedRecommendations": [
|
||||
|
||||
]
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
|
@ -14,21 +14,21 @@ appearance, race, religion, or sexual identity and orientation.
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
@ -7,9 +7,8 @@ Before publishing a PR, please test builds locally:
|
||||
- with VSCode for testing environments (only for frappe/bench image).
|
||||
|
||||
On each PR that contains changes relevant to Docker builds, images are being built and tested in our CI (GitHub Actions).
|
||||
> :evergreen_tree: Please be considerate when pushing commits and opening PR for multiple branches, as the process of building images uses energy and contributes to global warming.
|
||||
>
|
||||
|
||||
> :evergreen_tree: Please be considerate when pushing commits and opening PR for multiple branches, as the process of building images uses energy and contributes to global warming.
|
||||
|
||||
## Lint
|
||||
|
||||
@ -38,7 +37,6 @@ To run all the files in repository, run:
|
||||
pre-commit run --all-files
|
||||
```
|
||||
|
||||
|
||||
## Build
|
||||
|
||||
```shell
|
||||
@ -52,20 +50,25 @@ docker buildx bake -f docker-bake.hcl *...*
|
||||
## Test
|
||||
|
||||
### Ping site
|
||||
|
||||
Lightweight test that just checks if site will be available after creation.
|
||||
|
||||
Frappe:
|
||||
|
||||
```shell
|
||||
./tests/test-frappe.sh
|
||||
```
|
||||
|
||||
ERPNext:
|
||||
|
||||
```shell
|
||||
./tests/test-erpnext.sh
|
||||
```
|
||||
|
||||
### Integration test
|
||||
|
||||
Tests frappe-bench-like commands, for example, `backup` and `restore`.
|
||||
|
||||
```shell
|
||||
./tests/integration-test.sh
|
||||
```
|
||||
|
10
README.md
10
README.md
@ -30,14 +30,14 @@ cd frappe_docker
|
||||
|
||||
It takes care of the following:
|
||||
|
||||
* Setting up the desired version of Frappe/ERPNext.
|
||||
* Setting up all the system requirements: eg. MariaDB, Node, Redis.
|
||||
* Configure networking for remote access and setting up LetsEncrypt.
|
||||
- Setting up the desired version of Frappe/ERPNext.
|
||||
- Setting up all the system requirements: eg. MariaDB, Node, Redis.
|
||||
- Configure networking for remote access and setting up LetsEncrypt.
|
||||
|
||||
It doesn't take care of the following:
|
||||
|
||||
* Cron Job to backup sites is not created by default.
|
||||
* Use `CronJob` on k8s or refer wiki for alternatives.
|
||||
- Cron Job to backup sites is not created by default.
|
||||
- Use `CronJob` on k8s or refer wiki for alternatives.
|
||||
|
||||
1. Single Server Installs
|
||||
1. [Single bench](docs/single-bench.md). Easiest Install!
|
||||
|
@ -94,6 +94,7 @@ code Procfile
|
||||
```
|
||||
|
||||
Or running the following command:
|
||||
|
||||
```shell
|
||||
sed -i '/redis/d' ./Procfile
|
||||
```
|
||||
@ -105,6 +106,7 @@ You can create a new site with the following command:
|
||||
```shell
|
||||
bench new-site sitename --no-mariadb-socket
|
||||
```
|
||||
|
||||
sitename MUST end with .localhost for trying deployments locally.
|
||||
|
||||
for example:
|
||||
@ -259,7 +261,6 @@ Example shows the queries to be executed for site `localhost`
|
||||
|
||||
Open sites/localhost/site_config.json:
|
||||
|
||||
|
||||
```shell
|
||||
code sites/localhost/site_config.json
|
||||
```
|
||||
@ -286,6 +287,7 @@ EXIT;
|
||||
In case you don't use VSCode, you may start the containers manually with the following command:
|
||||
|
||||
### Running the containers
|
||||
|
||||
```shell
|
||||
docker-compose -f .devcontainer/docker-compose.yml up -d
|
||||
```
|
||||
|
@ -10,7 +10,12 @@
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/frappe-bench/apps/frappe/frappe/utils/bench_helper.py",
|
||||
"args": [
|
||||
"frappe", "serve", "--port", "8000", "--noreload", "--nothreading"
|
||||
"frappe",
|
||||
"serve",
|
||||
"--port",
|
||||
"8000",
|
||||
"--noreload",
|
||||
"--nothreading"
|
||||
],
|
||||
"pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python",
|
||||
"cwd": "${workspaceFolder}/frappe-bench/sites",
|
||||
@ -23,9 +28,7 @@
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/frappe-bench/apps/frappe/frappe/utils/bench_helper.py",
|
||||
"args": [
|
||||
"frappe", "worker", "--queue", "default"
|
||||
],
|
||||
"args": ["frappe", "worker", "--queue", "default"],
|
||||
"pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python",
|
||||
"cwd": "${workspaceFolder}/frappe-bench/sites",
|
||||
"env": {
|
||||
@ -37,9 +40,7 @@
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/frappe-bench/apps/frappe/frappe/utils/bench_helper.py",
|
||||
"args": [
|
||||
"frappe", "worker", "--queue", "short"
|
||||
],
|
||||
"args": ["frappe", "worker", "--queue", "short"],
|
||||
"pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python",
|
||||
"cwd": "${workspaceFolder}/frappe-bench/sites",
|
||||
"env": {
|
||||
@ -51,9 +52,7 @@
|
||||
"type": "python",
|
||||
"request": "launch",
|
||||
"program": "${workspaceFolder}/frappe-bench/apps/frappe/frappe/utils/bench_helper.py",
|
||||
"args": [
|
||||
"frappe", "worker", "--queue", "long"
|
||||
],
|
||||
"args": ["frappe", "worker", "--queue", "long"],
|
||||
"pythonPath": "${workspaceFolder}/frappe-bench/env/bin/python",
|
||||
"cwd": "${workspaceFolder}/frappe-bench/sites",
|
||||
"env": {
|
||||
@ -69,7 +68,13 @@
|
||||
"cwd": "${workspaceFolder}/frappe-bench",
|
||||
"console": "internalConsole",
|
||||
"args": [
|
||||
"start", "socketio", "watch", "schedule", "worker_short", "worker_long", "worker_default"
|
||||
"start",
|
||||
"socketio",
|
||||
"watch",
|
||||
"schedule",
|
||||
"worker_short",
|
||||
"worker_long",
|
||||
"worker_default"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
@ -42,7 +42,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
mariadb-master:
|
||||
image: 'bitnami/mariadb:10.3'
|
||||
image: "bitnami/mariadb:10.3"
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
@ -54,7 +54,7 @@ services:
|
||||
secrets:
|
||||
- frappe-mariadb-root-password
|
||||
volumes:
|
||||
- 'mariadb_master_data:/bitnami/mariadb'
|
||||
- "mariadb_master_data:/bitnami/mariadb"
|
||||
environment:
|
||||
- MARIADB_REPLICATION_MODE=master
|
||||
- MARIADB_REPLICATION_USER=repl_user
|
||||
@ -62,7 +62,7 @@ services:
|
||||
- MARIADB_ROOT_PASSWORD_FILE=/run/secrets/frappe-mariadb-root-password
|
||||
|
||||
mariadb-slave:
|
||||
image: 'bitnami/mariadb:10.3'
|
||||
image: "bitnami/mariadb:10.3"
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
@ -74,7 +74,7 @@ services:
|
||||
secrets:
|
||||
- frappe-mariadb-root-password
|
||||
volumes:
|
||||
- 'mariadb_slave_data:/bitnami/mariadb'
|
||||
- "mariadb_slave_data:/bitnami/mariadb"
|
||||
environment:
|
||||
- MARIADB_REPLICATION_MODE=slave
|
||||
- MARIADB_REPLICATION_USER=repl_user
|
||||
@ -265,6 +265,7 @@ Use environment variables:
|
||||
- `FRAPPE_VERSION` variable to be set to desired version of Frappe Framework. e.g. 12.7.0
|
||||
- `MARIADB_HOST=frappe-mariadb_mariadb-master`
|
||||
- `SITES` variable is list of sites in back tick and separated by comma
|
||||
|
||||
```
|
||||
SITES=`site1.example.com`,`site2.example.com`
|
||||
```
|
||||
|
@ -123,46 +123,49 @@ Notes:
|
||||
## Docker containers
|
||||
|
||||
This repository contains the following docker-compose files, each one containing the described images:
|
||||
* docker-compose-common.yml
|
||||
* redis-cache
|
||||
* volume: redis-cache-vol
|
||||
* redis-queue
|
||||
* volume: redis-queue-vol
|
||||
* redis-socketio
|
||||
* volume: redis-socketio-vol
|
||||
* mariadb: main database
|
||||
* volume: mariadb-vol
|
||||
* docker-compose-erpnext.yml
|
||||
* erpnext-nginx: serves static assets and proxies web request to the appropriate container, allowing to offer all services on the same port.
|
||||
* volume: assets-vol
|
||||
* erpnext-python: main application code
|
||||
* frappe-socketio: enables realtime communication to the user interface through websockets
|
||||
* frappe-worker-default: background runner
|
||||
* frappe-worker-short: background runner for short-running jobs
|
||||
* frappe-worker-long: background runner for long-running jobs
|
||||
* frappe-schedule
|
||||
|
||||
* docker-compose-frappe.yml
|
||||
* frappe-nginx: serves static assets and proxies web request to the appropriate container, allowing to offer all services on the same port.
|
||||
* volume: assets-vol, sites-vol
|
||||
* erpnext-python: main application code
|
||||
* volume: sites-vol
|
||||
* frappe-socketio: enables realtime communication to the user interface through websockets
|
||||
* volume: sites-vol
|
||||
* frappe-worker-default: background runner
|
||||
* volume: sites-vol
|
||||
* frappe-worker-short: background runner for short-running jobs
|
||||
* volume: sites-vol
|
||||
* frappe-worker-long: background runner for long-running jobs
|
||||
* volume: sites-vol
|
||||
* frappe-schedule
|
||||
* volume: sites-vol
|
||||
- docker-compose-common.yml
|
||||
- redis-cache
|
||||
- volume: redis-cache-vol
|
||||
- redis-queue
|
||||
- volume: redis-queue-vol
|
||||
- redis-socketio
|
||||
- volume: redis-socketio-vol
|
||||
- mariadb: main database
|
||||
- volume: mariadb-vol
|
||||
- docker-compose-erpnext.yml
|
||||
|
||||
* docker-compose-networks.yml: this yaml define the network to communicate with *Letsencrypt Nginx Proxy Companion*.
|
||||
- erpnext-nginx: serves static assets and proxies web request to the appropriate container, allowing to offer all services on the same port.
|
||||
- volume: assets-vol
|
||||
- erpnext-python: main application code
|
||||
- frappe-socketio: enables realtime communication to the user interface through websockets
|
||||
- frappe-worker-default: background runner
|
||||
- frappe-worker-short: background runner for short-running jobs
|
||||
- frappe-worker-long: background runner for long-running jobs
|
||||
- frappe-schedule
|
||||
|
||||
* erpnext-publish.yml: this yml extends erpnext-nginx service to publish port 80, can only be used with docker-compose-erpnext.yml
|
||||
- docker-compose-frappe.yml
|
||||
|
||||
* frappe-publish.yml: this yml extends frappe-nginx service to publish port 80, can only be used with docker-compose-frappe.yml
|
||||
- frappe-nginx: serves static assets and proxies web request to the appropriate container, allowing to offer all services on the same port.
|
||||
- volume: assets-vol, sites-vol
|
||||
- erpnext-python: main application code
|
||||
- volume: sites-vol
|
||||
- frappe-socketio: enables realtime communication to the user interface through websockets
|
||||
- volume: sites-vol
|
||||
- frappe-worker-default: background runner
|
||||
- volume: sites-vol
|
||||
- frappe-worker-short: background runner for short-running jobs
|
||||
- volume: sites-vol
|
||||
- frappe-worker-long: background runner for long-running jobs
|
||||
- volume: sites-vol
|
||||
- frappe-schedule
|
||||
- volume: sites-vol
|
||||
|
||||
- docker-compose-networks.yml: this yaml define the network to communicate with _Letsencrypt Nginx Proxy Companion_.
|
||||
|
||||
- erpnext-publish.yml: this yml extends erpnext-nginx service to publish port 80, can only be used with docker-compose-erpnext.yml
|
||||
|
||||
- frappe-publish.yml: this yml extends frappe-nginx service to publish port 80, can only be used with docker-compose-frappe.yml
|
||||
|
||||
## Updating and Migrating Sites
|
||||
|
||||
|
@ -37,7 +37,7 @@ To get started, copy the existing `env-local` or `env-production` file to `.env`
|
||||
- `SITE_NAME=erp.example.com`
|
||||
- Creates this site after starting all services and installs ERPNext. Site name must be resolvable by users machines and the ERPNext components. e.g. `erp.example.com` or `mysite.localhost`.
|
||||
- `` SITES=`erp.example.com` ``
|
||||
- List of sites that are part of the deployment "bench" Each site is separated by a comma(,) and quoted in backtick (`). By default site created by ``SITE_NAME`` variable is added here.
|
||||
- List of sites that are part of the deployment "bench" Each site is separated by a comma(,) and quoted in backtick (`). By default site created by `SITE_NAME` variable is added here.
|
||||
- If LetsEncrypt is being setup, make sure that the DNS for all the site's domains correctly point to the current instance.
|
||||
- `DB_ROOT_USER=root`
|
||||
- MariaDB root username
|
||||
@ -77,7 +77,7 @@ Make sure to replace `<project-name>` with the desired name you wish to set for
|
||||
|
||||
Notes:
|
||||
|
||||
- If it is the first time running and site is being initialized, *it can take multiple minutes for the site to be up*. Monitor `site-creator` container logs to check progress. Use command `docker logs <project-name>_site-creator_1 -f`
|
||||
- If it is the first time running and site is being initialized, _it can take multiple minutes for the site to be up_. Monitor `site-creator` container logs to check progress. Use command `docker logs <project-name>_site-creator_1 -f`
|
||||
- After the site is ready the username is `Administrator` and the password is `$ADMIN_PASSWORD`
|
||||
- The local deployment is for testing and REST API development purpose only
|
||||
- A complete development environment is available [here](../development)
|
||||
@ -86,32 +86,32 @@ Notes:
|
||||
|
||||
The docker-compose file contains following services:
|
||||
|
||||
* traefik: manages letsencrypt
|
||||
* volume: cert-vol
|
||||
* redis-cache: cache store
|
||||
* volume: redis-cache-vol
|
||||
* redis-queue: used by workers
|
||||
* volume: redis-queue-vol
|
||||
* redis-socketio: used by socketio service
|
||||
* volume: redis-socketio-vol
|
||||
* mariadb: main database
|
||||
* volume: mariadb-vol
|
||||
* erpnext-nginx: serves static assets and proxies web request to the appropriate container, allowing to offer all services on the same port.
|
||||
* volume: assets-vol and sites-vol
|
||||
* erpnext-python: main application code
|
||||
* volume: sites-vol and sites-vol
|
||||
* frappe-socketio: enables realtime communication to the user interface through websockets
|
||||
* volume: sites-vol
|
||||
* erpnext-worker-default: background runner
|
||||
* volume: sites-vol
|
||||
* erpnext-worker-short: background runner for short-running jobs
|
||||
* volume: sites-vol
|
||||
* erpnext-worker-long: background runner for long-running jobs
|
||||
* volume: sites-vol
|
||||
* erpnext-schedule
|
||||
* volume: sites-vol
|
||||
* site-creator: run once container to create new site.
|
||||
* volume: sites-vol
|
||||
- traefik: manages letsencrypt
|
||||
- volume: cert-vol
|
||||
- redis-cache: cache store
|
||||
- volume: redis-cache-vol
|
||||
- redis-queue: used by workers
|
||||
- volume: redis-queue-vol
|
||||
- redis-socketio: used by socketio service
|
||||
- volume: redis-socketio-vol
|
||||
- mariadb: main database
|
||||
- volume: mariadb-vol
|
||||
- erpnext-nginx: serves static assets and proxies web request to the appropriate container, allowing to offer all services on the same port.
|
||||
- volume: assets-vol and sites-vol
|
||||
- erpnext-python: main application code
|
||||
- volume: sites-vol and sites-vol
|
||||
- frappe-socketio: enables realtime communication to the user interface through websockets
|
||||
- volume: sites-vol
|
||||
- erpnext-worker-default: background runner
|
||||
- volume: sites-vol
|
||||
- erpnext-worker-short: background runner for short-running jobs
|
||||
- volume: sites-vol
|
||||
- erpnext-worker-long: background runner for long-running jobs
|
||||
- volume: sites-vol
|
||||
- erpnext-schedule
|
||||
- volume: sites-vol
|
||||
- site-creator: run once container to create new site.
|
||||
- volume: sites-vol
|
||||
|
||||
## Updating and Migrating Sites
|
||||
|
||||
|
@ -168,16 +168,16 @@ Note:
|
||||
- /home/frappe/backups
|
||||
- site1.domain.com
|
||||
- 20200420_162000
|
||||
- 20200420_162000-site1_domain_com-*
|
||||
- 20200420_162000-site1_domain_com-\*
|
||||
- site2.domain.com
|
||||
- 20200420_162000
|
||||
- 20200420_162000-site2_domain_com-*
|
||||
- 20200420_162000-site2_domain_com-\*
|
||||
|
||||
## Edit configs
|
||||
|
||||
Editing config manually might be required in some cases,
|
||||
one such case is to use Amazon RDS (or any other DBaaS).
|
||||
For full instructions, refer to the [wiki](https://github.com/frappe/frappe/wiki/Using-Frappe-with-Amazon-RDS-(or-any-other-DBaaS)). Common question can be found in Issues and on forum.
|
||||
For full instructions, refer to the [wiki](<https://github.com/frappe/frappe/wiki/Using-Frappe-with-Amazon-RDS-(or-any-other-DBaaS)>). Common question can be found in Issues and on forum.
|
||||
|
||||
`common_site_config.json` or `site_config.json` from `sites-vol` volume has to be edited using following command:
|
||||
|
||||
@ -231,7 +231,6 @@ Notes:
|
||||
- Use it to install/uninstall custom apps, add system manager user, etc.
|
||||
- To run the command as non root user add the command option `--user frappe`.
|
||||
|
||||
|
||||
## Delete/Drop Site
|
||||
|
||||
#### MariaDB Site
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
redis-cache:
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
erpnext-nginx:
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: "3"
|
||||
|
||||
services:
|
||||
frappe-nginx:
|
||||
|
@ -1,4 +1,4 @@
|
||||
version: '3'
|
||||
version: "3"
|
||||
|
||||
networks:
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user