Add Local Dev Environment Setup
parent
eeab4564d9
commit
f7dca71fdd
65
Local-Dev-Environment-Setup.md
Normal file
65
Local-Dev-Environment-Setup.md
Normal file
@ -0,0 +1,65 @@
|
||||
# Getting Started
|
||||
|
||||
## Prerequisites
|
||||
In order to start developing you need to satisfy the following prerequisites:
|
||||
|
||||
- Docker: [Docker Engine](https://docs.docker.com/engine/install/ubuntu/)
|
||||
- docker-compose: [Docker Engine](https://docs.docker.com/engine/install/ubuntu/)
|
||||
- Add current user to docker group: `sudo usermod -aG docker $USER` (you might have to logout and login again, or reboot your OS for changes to take effect)
|
||||
- Git
|
||||
- VS Code or VS Codium (VS Codium not tested)
|
||||
- Dev Containers extension installed for VS Code. [Dev Containers](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)
|
||||
|
||||
## Step-By-Step Setup
|
||||
- Request access to Shiloh's private `frappe_docker` git repo. Clone and cd to `frappe_docker` dir.
|
||||
```
|
||||
git clone https://githaven.org/Shiloh/frappe_docker.git
|
||||
cd frappe_docker
|
||||
```
|
||||
- Run:
|
||||
```
|
||||
cp -r devcontainer-example .devcontainer
|
||||
cp -r development/vscode-example development/.vscode
|
||||
```
|
||||
- Open project in VSCode:
|
||||
```
|
||||
code .
|
||||
```
|
||||
- When VS Code is opened, you should see a pop-up in the bottom right that says: "Reopen In Container". Select that and the dev container will be built and started automatically. If you don't see the pop up, close VS Code and reopen it. Alternatively, open VS Code, open command palette `Ctrl + Shift + P` then search for and select "Reopen in Container" **If this doesn't work, you might not have added your current user to the docker group correctly. This is required and can be tested by running docker commands without sudo i.e. `docker ps`**
|
||||
- Once the dev container is finished building and you are in the new dev container VS Code window, copy `apps-example.json` to `apps.json`:
|
||||
```
|
||||
cp apps-example.json apps.json
|
||||
```
|
||||
- In apps.json, define the git repos and branches, which are apps, to be installed:
|
||||
```
|
||||
[
|
||||
{
|
||||
"url": "https://githaven.org/Shiloh/brotherton-erpnext",
|
||||
"branch": "production"
|
||||
},
|
||||
{
|
||||
"url": "https://github.com/frappe/hrms",
|
||||
"branch": "version-15"
|
||||
}
|
||||
]
|
||||
|
||||
```
|
||||
- Run `installer.py` with the following flags (read `installer.py` to see what it does and for additional flags):
|
||||
```
|
||||
python installer.py -j apps.json -s deverpnext.localhost -p 3.10.13 -v
|
||||
```
|
||||
- cd into new frappe-bench folder and start python virtual environment:
|
||||
```
|
||||
cd frappe-bench
|
||||
. env/bin/activate
|
||||
```
|
||||
- Set default site in Bench:
|
||||
```bench use development.localhost
|
||||
```
|
||||
- From /frappe-bench dir, start dev server:
|
||||
```bench start
|
||||
```
|
||||
- you should be able to now access your site with all of the apps you specified in `apps.json` at
|
||||
```
|
||||
http://localhost:8000
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user