From ea63b74f6b0c9cd129a0c36c18056b30f557c80e Mon Sep 17 00:00:00 2001 From: Lev Vereshchagin Date: Sun, 20 Mar 2022 20:46:04 +0300 Subject: [PATCH] Update custom app guide --- custom_app/README.md | 4 ++-- custom_app/backend.Dockerfile | 5 +++-- custom_app/docker-bake.hcl | 4 +++- custom_app/frontend.Dockerfile | 4 +++- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/custom_app/README.md b/custom_app/README.md index c78493ad..810d77da 100644 --- a/custom_app/README.md +++ b/custom_app/README.md @@ -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= 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. diff --git a/custom_app/backend.Dockerfile b/custom_app/backend.Dockerfile index 8febe6cc..cc779b1c 100644 --- a/custom_app/backend.Dockerfile +++ b/custom_app/backend.Dockerfile @@ -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 diff --git a/custom_app/docker-bake.hcl b/custom_app/docker-bake.hcl index 12aa7d0e..64971aa7 100644 --- a/custom_app/docker-bake.hcl +++ b/custom_app/docker-bake.hcl @@ -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 } } diff --git a/custom_app/frontend.Dockerfile b/custom_app/frontend.Dockerfile index acca52cc..09424c17 100644 --- a/custom_app/frontend.Dockerfile +++ b/custom_app/frontend.Dockerfile @@ -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