rudimentary docs

This commit is contained in:
chabad360
2020-03-06 06:12:11 +00:00
parent b254e018e5
commit be8f0e4fa0
2 changed files with 174 additions and 0 deletions

View File

@@ -161,6 +161,63 @@ docker exec -it \
<project-name>_erpnext-python_1 docker-entrypoint.sh migrate
```
### Custom apps
> For the sake of example, we'll be using a place holder called `[custom]`, and we'll be building off the edge image.
To add your own apps to the image, we'll need to create a custom image with the help of a special wrapper script
1. Create two folders called `[custom]-worker` and `[custom]-assets` in the `build` folder.
```bash
cd frappe_docker
mkdir ./build/[custom]-worker ./build/[custom]-assets
```
2. Create a `Dockerfile` in `./build/[custom]-worker` with the following content:
```Dockerfile
FROM frappe/erpnext-worker:edge
RUN install_app [custom] https://github.com/[username]/[custom] [branch]
# Only add the branch if you are using a specific tag or branch.
```
3. Create a `Dockerfile` in `./build/[custom]-assets` with the following content:
```Dockerfile
FROM bitnami/node:12-prod
COPY build/[custom]-assets/install_app.sh /install_app
RUN /install_app [custom] https://github.com/[username]/[custom]
FROM frappe/erpnext-assets:edge
COPY --from=0 /home/frappe/frappe-bench/sites/ /var/www/html/
COPY --from=0 /rsync /rsync
RUN echo -n "\nerpnext" >> /var/www/html/apps.txt
VOLUME [ "/assets" ]
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["nginx", "-g", "daemon off;"]
```
4. Copy over the `install_app.sh` file from `./build/erpnext-assets`
```bash
cp ./build/erpnext-assets/install.sh ./build/[custom]-assets
```
5. Open up `./installation/docker-compose-custom.yml` and replace all instances of `[app]` with the name of your app.
```bash
sed -i "s#\[app\]#[custom]#" ./installation/docker-compose-custom.yml
```
6. Install like usuall, except that when you set the `INSTALL_APPS` variable set it to `erpnext,[custom]`.
### Troubleshoot
1. Remove containers and volumes, and clear redis cache: