-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: setup github codespaces (#140)
- Loading branch information
1 parent
1a927af
commit fb19b9f
Showing
3 changed files
with
113 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"name": "Frappe Bench", | ||
"forwardPorts": [8000, 9000, 6787], | ||
"remoteUser": "frappe", | ||
"settings": { | ||
"terminal.integrated.defaultProfile.linux": "bash", | ||
"debug.node.autoAttach": "disabled" | ||
}, | ||
"dockerComposeFile": "./docker-compose.yml", | ||
"service": "frappe", | ||
"workspaceFolder": "/workspace/frappe-bench", | ||
"postCreateCommand": "bash /workspace/scripts/init.sh", | ||
"shutdownAction": "stopCompose", | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-vscode.live-server", | ||
"grapecity.gc-excelviewer", | ||
"mtxr.sqltools", | ||
"visualstudioexptteam.vscodeintellicode" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
version: "3.7" | ||
services: | ||
mariadb: | ||
image: mariadb:10.6 | ||
command: | ||
- --character-set-server=utf8mb4 | ||
- --collation-server=utf8mb4_unicode_ci | ||
- --skip-character-set-client-handshake | ||
- --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 123 | ||
volumes: | ||
- mariadb-data:/var/lib/mysql | ||
|
||
# Enable PostgreSQL only if you use it, see development/README.md for more information. | ||
# postgresql: | ||
# image: postgres:11.8 | ||
# environment: | ||
# POSTGRES_PASSWORD: 123 | ||
# volumes: | ||
# - postgresql-data:/var/lib/postgresql/data | ||
|
||
redis-cache: | ||
image: redis:alpine | ||
|
||
redis-queue: | ||
image: redis:alpine | ||
|
||
redis-socketio: | ||
image: redis:alpine | ||
|
||
frappe: | ||
image: frappe/bench:latest | ||
command: sleep infinity | ||
environment: | ||
- SHELL=/bin/bash | ||
volumes: | ||
- ..:/workspace:cached | ||
working_dir: /workspace/frappe-bench | ||
ports: | ||
- 8000-8005:8000-8005 | ||
- 9000-9005:9000-9005 | ||
|
||
volumes: | ||
mariadb-data: | ||
postgresql-data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!bin/bash | ||
|
||
set -e | ||
|
||
if [[ -f "/workspaces/frappe_codespace/frappe-bench/apps/frappe" ]] | ||
then | ||
echo "Bench already exists, skipping init" | ||
exit 0 | ||
fi | ||
|
||
rm -rf /workspaces/frappe_codespace/.git | ||
|
||
source /home/frappe/.nvm/nvm.sh | ||
nvm alias default 18 | ||
nvm use 18 | ||
|
||
echo "nvm use 18" >> ~/.bashrc | ||
cd /workspace | ||
|
||
bench init \ | ||
--ignore-exist \ | ||
--skip-redis-config-generation \ | ||
frappe-bench | ||
|
||
cd frappe-bench | ||
|
||
# Use containers instead of localhost | ||
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 | ||
|
||
# Remove redis from Procfile | ||
sed -i '/redis/d' ./Procfile | ||
|
||
|
||
bench new-site dev.localhost \ | ||
--mariadb-root-password 123 \ | ||
--admin-password admin \ | ||
--no-mariadb-socket | ||
|
||
bench --site dev.localhost set-config developer_mode 1 | ||
bench --site dev.localhost clear-cache | ||
bench use dev.localhost | ||
bench get-app print_designer | ||
bench --site dev.localhost install-app print_designer |