mirror of
https://github.com/frappe/frappe_docker.git
synced 2026-06-22 15:55:09 +00:00
add script to create new site
This commit is contained in:
parent
3354b0e4bc
commit
820a20098b
1 changed files with 11 additions and 0 deletions
11
.devcontainer/new-site.sh
Executable file
11
.devcontainer/new-site.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
||||||
|
|
||||||
|
SITE_NAME=${1:-"development.localhost"}
|
||||||
|
DB_NAME=${2:-"dev_db"}
|
||||||
|
ROOT_PASS=${3:-"123"}
|
||||||
|
|
||||||
|
bench new-site "$SITE_NAME" --db-name "$DB_NAME" --mariadb-root-password "$ROOT_PASS"
|
||||||
|
|
||||||
|
|
||||||
|
# patch to allow connection from any ip address
|
||||||
|
CONTAINER_IP=$(hostname -i)
|
||||||
|
mysql -u root -p"$ROOT_PASS" -h mariadb -e "RENAME USER '$DB_NAME'@'$CONTAINER_IP' TO '$DB_NAME'@'%'; FLUSH PRIVILEGES;"
|
||||||
Loading…
Reference in a new issue