mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-26 09:05:10 +00:00
Merge pull request #324 from frappe/develop
chore: merge develop to master
This commit is contained in:
commit
024d5365f1
8 changed files with 33 additions and 59 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
|
@ -13,3 +13,6 @@ deploy_key.pub
|
||||||
|
|
||||||
# Pycharm
|
# Pycharm
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
# VS Code devcontainer
|
||||||
|
.devcontainer
|
||||||
|
|
|
||||||
|
|
@ -7,4 +7,6 @@ DB_PORT = 3306
|
||||||
APP_VERSIONS_JSON_FILE = 'app_versions.json'
|
APP_VERSIONS_JSON_FILE = 'app_versions.json'
|
||||||
APPS_TXT_FILE = 'apps.txt'
|
APPS_TXT_FILE = 'apps.txt'
|
||||||
COMMON_SITE_CONFIG_FILE = 'common_site_config.json'
|
COMMON_SITE_CONFIG_FILE = 'common_site_config.json'
|
||||||
DATE_FORMAT = "%Y%m%d_%H%M%S"
|
DATE_FORMAT = "%Y%m%d_%H%M%S"
|
||||||
|
RDS_DB = 'rds_db'
|
||||||
|
RDS_PRIVILEGES = "SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, INDEX, ALTER, CREATE TEMPORARY TABLES, CREATE VIEW, EVENT, TRIGGER, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EXECUTE, LOCK TABLES"
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import semantic_version
|
||||||
|
|
||||||
from frappe.commands.site import _new_site
|
from frappe.commands.site import _new_site
|
||||||
from frappe.installer import update_site_config
|
from frappe.installer import update_site_config
|
||||||
from constants import COMMON_SITE_CONFIG_FILE
|
from constants import COMMON_SITE_CONFIG_FILE, RDS_DB, RDS_PRIVILEGES
|
||||||
from utils import (
|
from utils import (
|
||||||
run_command,
|
run_command,
|
||||||
get_config,
|
get_config,
|
||||||
|
|
@ -93,7 +93,13 @@ def main():
|
||||||
run_command(command)
|
run_command(command)
|
||||||
|
|
||||||
# Grant permission to database
|
# Grant permission to database
|
||||||
command = mysql_command + [f"GRANT ALL PRIVILEGES ON `{db_name}`.* TO '{db_name}'@'%'; FLUSH PRIVILEGES;"]
|
grant_privileges = "ALL PRIVILEGES"
|
||||||
|
|
||||||
|
# for Amazon RDS
|
||||||
|
if config.get(RDS_DB) or site_config.get(RDS_DB):
|
||||||
|
grant_privileges = RDS_PRIVILEGES
|
||||||
|
|
||||||
|
command = mysql_command + [f"GRANT {grant_privileges} ON `{db_name}`.* TO '{db_name}'@'%'; FLUSH PRIVILEGES;"]
|
||||||
run_command(command)
|
run_command(command)
|
||||||
|
|
||||||
if frappe.redis_server:
|
if frappe.redis_server:
|
||||||
|
|
|
||||||
|
|
@ -1,47 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
## Thanks
|
|
||||||
# https://serverfault.com/a/919212
|
|
||||||
##
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
rsync -a --delete /var/www/html/assets/js /assets
|
|
||||||
rsync -a --delete /var/www/html/assets/css /assets
|
|
||||||
rsync -a --delete /var/www/html/assets/frappe /assets
|
|
||||||
. /rsync
|
|
||||||
|
|
||||||
chmod -R 755 /assets
|
|
||||||
|
|
||||||
if [[ -z "$FRAPPE_PY" ]]; then
|
|
||||||
export FRAPPE_PY=0.0.0.0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "$FRAPPE_PY_PORT" ]]; then
|
|
||||||
export FRAPPE_PY_PORT=8000
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "$FRAPPE_SOCKETIO" ]]; then
|
|
||||||
export FRAPPE_SOCKETIO=0.0.0.0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "$SOCKETIO_PORT" ]]; then
|
|
||||||
export SOCKETIO_PORT=9000
|
|
||||||
fi
|
|
||||||
|
|
||||||
envsubst '${API_HOST}
|
|
||||||
${API_PORT}
|
|
||||||
${FRAPPE_PY}
|
|
||||||
${FRAPPE_PY_PORT}
|
|
||||||
${FRAPPE_SOCKETIO}
|
|
||||||
${SOCKETIO_PORT}' \
|
|
||||||
< /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
echo "Waiting for frappe-python to be available on $FRAPPE_PY port $FRAPPE_PY_PORT"
|
|
||||||
timeout 10 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' $FRAPPE_PY $FRAPPE_PY_PORT
|
|
||||||
echo "Frappe-python available on $FRAPPE_PY port $FRAPPE_PY_PORT"
|
|
||||||
echo "Waiting for frappe-socketio to be available on $FRAPPE_SOCKETIO port $SOCKETIO_PORT"
|
|
||||||
timeout 10 bash -c 'until printf "" 2>>/dev/null >>/dev/tcp/$0/$1; do sleep 1; done' $FRAPPE_SOCKETIO $SOCKETIO_PORT
|
|
||||||
echo "Frappe-socketio available on $FRAPPE_SOCKETIO port $SOCKETIO_PORT"
|
|
||||||
|
|
||||||
exec "$@"
|
|
||||||
|
|
@ -9,13 +9,14 @@ services:
|
||||||
- ../installation/frappe-mariadb.cnf:/etc/mysql/conf.d/frappe.cnf
|
- ../installation/frappe-mariadb.cnf:/etc/mysql/conf.d/frappe.cnf
|
||||||
- mariadb-vol:/var/lib/mysql
|
- mariadb-vol:/var/lib/mysql
|
||||||
|
|
||||||
postgresql:
|
# Enable PostgreSQL only if you use it, see development/README.md for more information.
|
||||||
image: postgres:11.8
|
# postgresql:
|
||||||
restart: on-failure
|
# image: postgres:11.8
|
||||||
environment:
|
# restart: on-failure
|
||||||
- POSTGRES_PASSWORD=123
|
# environment:
|
||||||
volumes:
|
# - POSTGRES_PASSWORD=123
|
||||||
- postgresql-vol:/var/lib/postgresql/data
|
# volumes:
|
||||||
|
# - postgresql-vol:/var/lib/postgresql/data
|
||||||
|
|
||||||
redis-cache:
|
redis-cache:
|
||||||
image: redis:alpine
|
image: redis:alpine
|
||||||
2
development/.vscode/settings.json
vendored
2
development/.vscode/settings.json
vendored
|
|
@ -1,4 +1,4 @@
|
||||||
{
|
{
|
||||||
"python.pythonPath": "frappe-bench/env/bin/python",
|
"python.pythonPath": "frappe-bench/env/bin/python",
|
||||||
"debug.node.autoAttach": "on"
|
"debug.node.autoAttach": "disabled"
|
||||||
}
|
}
|
||||||
|
|
@ -22,9 +22,18 @@ git clone https://github.com/frappe/frappe_docker.git
|
||||||
cd frappe_docker
|
cd frappe_docker
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Copy example devcontainer config from `devcontainer-example` to `.devcontainer`
|
||||||
|
|
||||||
|
```shell
|
||||||
|
cp -R devcontainer-example .devcontainer
|
||||||
|
```
|
||||||
|
|
||||||
## Use VSCode Remote Containers extension
|
## Use VSCode Remote Containers extension
|
||||||
|
|
||||||
For most people getting started with Frappe development, the best solution is to use [ VSCode Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
|
For most people getting started with Frappe development, the best solution is to use [VSCode Remote - Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers).
|
||||||
|
|
||||||
|
Before opening the folder in container, determine the database that you want to use. The default is MariaDB.
|
||||||
|
If you want to use PostgreSQL instead, edit `.devcontainer/docker-compose.yml` and uncomment the section for `postgresql` service, and you may also want to comment `mariadb` as well.
|
||||||
|
|
||||||
VSCode should automatically inquire you to install the required extensions, that can also be installed manually as follows:
|
VSCode should automatically inquire you to install the required extensions, that can also be installed manually as follows:
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue