2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-09-18 18:19:02 +00:00

Clarification on how to use custom image (#1062)

* Clarification on how to use custom image

* chore: fix lint

* refactor: websocket uses also customizable_image

---------

Co-authored-by: Mauricio Vidal <maovidal@users.noreply.github.com>
This commit is contained in:
Mauricio Vidal 2023-02-01 11:42:08 -05:00 committed by GitHub
parent 31aed68670
commit 87870be936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 4 deletions

View File

@ -1,3 +1,9 @@
x-customizable-image: &customizable_image
# By default the image used only contains the `frappe` and `erpnext` apps.
# See https://github.com/frappe/frappe_docker/blob/main/docs/custom-apps.md
# about using custom images.
image: frappe/erpnext:${ERPNEXT_VERSION:?No ERPNext version set}
x-depends-on-configurator: &depends_on_configurator
depends_on:
configurator:
@ -5,7 +11,7 @@ x-depends-on-configurator: &depends_on_configurator
x-backend-defaults: &backend_defaults
<<: *depends_on_configurator
image: frappe/erpnext:${ERPNEXT_VERSION:?No ERPNext version set}
<<: *customizable_image
volumes:
- sites:/home/frappe/frappe-bench/sites
@ -36,7 +42,7 @@ services:
<<: *backend_defaults
frontend:
image: frappe/erpnext:${ERPNEXT_VERSION}
<<: *customizable_image
command:
- nginx-entrypoint.sh
environment:
@ -56,7 +62,7 @@ services:
websocket:
<<: *depends_on_configurator
image: frappe/erpnext:${ERPNEXT_VERSION}
<<: *customizable_image
command:
- node
- /home/frappe/frappe-bench/apps/frappe/socketio.js

View File

@ -57,7 +57,7 @@ Note:
- Use `docker` instead of `buildah` as per your setup.
- `FRAPPE_PATH` and `FRAPPE_BRANCH` build args are optional and can be overridden in case of fork/branch or test a PR.
- Make sure `APPS_JSON_BASE64` variable has correct base64 encoded JSON string. It is consumed as build arg, base64 encoding ensures it to be friendly with environment variables. Use `jq empty apps.json` to validate `apps.json` file.
- Make sure the `--tag` is valid image name that will be pushed to registry.
- Make sure the `--tag` is valid image name that will be pushed to registry. See section [below](#use-images) for remarks about its use.
- Change `--build-arg` as per version of Python, NodeJS, Frappe Framework repo and branch
- `.git` directories for all apps are removed from the image.
@ -100,4 +100,14 @@ More about [kaniko](https://github.com/GoogleContainerTools/kaniko)
### Use Images
On the [compose.yaml](../compose.yaml) replace the image reference to the `tag` you used when you built it. Then, if you used a tag like `custom_erpnext:staging` the `x-customizable-image` section will look like this:
```
x-customizable-image: &customizable_image
image: custom_erpnext:staging
pull_policy: never
```
The `pull_policy` above is optional and prevents `docker` to try to download the image when that one has been built locally.
Make sure image name is correct to be pushed to registry. After the images are pushed, you can pull them to servers to be deployed. If the registry is private, additional auth is needed.