Update custom app guide

This commit is contained in:
Lev Vereshchagin 2022-03-20 20:46:04 +03:00
parent 1b74925642
commit ea63b74f6b
4 changed files with 11 additions and 6 deletions

View file

@ -18,10 +18,10 @@ To get started, install Docker and [Buildx](https://github.com/docker/buildx#ins
Before the next step—to build images—replace "custom_app" with your app's name in `docker-bake.hcl`. After that, let's try to build:
```bash
FRAPPE_VERSION=<Frappe version you need> docker buildx bake
FRAPPE_VERSION=... ERPNEXT_VERSION=... docker buildx bake
```
> 💡 We assume that majority of our users use ERPNext, that's why images in this tutorial are based on ERPNext images. In case you don't want to use ERPNext, remove erpnext references in Dockerfiles and change base images to Frappe ones.
> 💡 We assume that majority of our users use ERPNext, that's why images in this tutorial are based on ERPNext images. If don't want ERPNext, change base image in Dockerfiles and remove ERPNEXT_VERSION from bake file.
If something goes wrong feel free to leave an issue.

View file

@ -1,6 +1,7 @@
# syntax=docker/dockerfile:1.3
ARG FRAPPE_VERSION
FROM frappe/erpnext-worker:${FRAPPE_VERSION}
ARG ERPNEXT_VERSION
FROM frappe/erpnext-worker:${ERPNEXT_VERSION}
USER root

View file

@ -1,6 +1,7 @@
APP_NAME="custom_app"
variable "FRAPPE_VERSION" {}
variable "ERPNEXT_VERSION" {}
group "default" {
targets = ["backend", "frontend"]
@ -10,7 +11,7 @@ target "backend" {
dockerfile = "backend.Dockerfile"
tags = ["custom_app/worker:latest"]
args = {
"FRAPPE_VERSION" = FRAPPE_VERSION
"ERPNEXT_VERSION" = ERPNEXT_VERSION
"APP_NAME" = APP_NAME
}
}
@ -20,6 +21,7 @@ target "frontend" {
tags = ["custom_app/nginx:latest"]
args = {
"FRAPPE_VERSION" = FRAPPE_VERSION
"ERPNEXT_VERSION" = ERPNEXT_VERSION
"APP_NAME" = APP_NAME
}
}

View file

@ -1,4 +1,6 @@
ARG FRAPPE_VERSION
ARG ERPNEXT_VERSION
FROM frappe/assets-builder:${FRAPPE_VERSION} as assets
ARG APP_NAME
@ -12,6 +14,6 @@ RUN install-app ${APP_NAME}
# RUN install-app ${APP_NAME} ${BRANCH} ${GIT_URL}
FROM frappe/erpnext-nginx:${FRAPPE_VERSION}
FROM frappe/erpnext-nginx:${ERPNEXT_VERSION}
COPY --from=assets /out /usr/share/nginx/html