-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow layered custom image build (#1497)
speed up build time pull builder image pack built assets into base image
- Loading branch information
Showing
3 changed files
with
66 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
ARG FRAPPE_BRANCH=version-15 | ||
ARG FRAPPE_PATH=https://github.com/frappe/frappe | ||
|
||
FROM frappe/build:${FRAPPE_BRANCH} AS builder | ||
|
||
RUN export APP_INSTALL_ARGS="" && \ | ||
if [ -n "${APPS_JSON_BASE64}" ]; then \ | ||
export APP_INSTALL_ARGS="--apps_path=/opt/frappe/apps.json"; \ | ||
fi && \ | ||
bench init ${APP_INSTALL_ARGS}\ | ||
--frappe-branch=${FRAPPE_BRANCH} \ | ||
--frappe-path=${FRAPPE_PATH} \ | ||
--no-procfile \ | ||
--no-backups \ | ||
--skip-redis-config-generation \ | ||
--verbose \ | ||
/home/frappe/frappe-bench && \ | ||
cd /home/frappe/frappe-bench && \ | ||
echo "{}" > sites/common_site_config.json && \ | ||
find apps -mindepth 1 -path "*/.git" | xargs rm -fr | ||
|
||
FROM frappe/base:${FRAPPE_BRANCH} AS backend | ||
|
||
USER frappe | ||
|
||
COPY --from=builder --chown=frappe:frappe /home/frappe/frappe-bench /home/frappe/frappe-bench | ||
|
||
WORKDIR /home/frappe/frappe-bench | ||
|
||
VOLUME [ \ | ||
"/home/frappe/frappe-bench/sites", \ | ||
"/home/frappe/frappe-bench/sites/assets", \ | ||
"/home/frappe/frappe-bench/logs" \ | ||
] | ||
|
||
CMD [ \ | ||
"/home/frappe/frappe-bench/env/bin/gunicorn", \ | ||
"--chdir=/home/frappe/frappe-bench/sites", \ | ||
"--bind=0.0.0.0:8000", \ | ||
"--threads=4", \ | ||
"--workers=2", \ | ||
"--worker-class=gthread", \ | ||
"--worker-tmp-dir=/dev/shm", \ | ||
"--timeout=120", \ | ||
"--preload", \ | ||
"frappe.app:application" \ | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters