Deprecate assets builder (#922)

* feat: remove assets-builder image

* ci: remove version 12 builds

* fix: v13 nginx builds
This commit is contained in:
Revant Nandgaonkar
2022-09-12 14:20:05 +05:30
committed by GitHub
parent 2c1e5425b6
commit ec584ba9c8
6 changed files with 54 additions and 96 deletions

View File

@@ -1,13 +1,37 @@
ARG FRAPPE_VERSION
ARG ERPNEXT_VERSION
FROM frappe/assets-builder:${FRAPPE_VERSION} as assets
ARG FRAPPE_VERSION=version-14
# Prepare builder image
FROM frappe/bench:latest as assets
ARG FRAPPE_VERSION=version-14
ARG ERPNEXT_VERSION=version-14
ARG APP_NAME
COPY . apps/${APP_NAME}
RUN install-app ${APP_NAME}
# Setup frappe-bench using FRAPPE_VERSION
RUN bench init --version=${FRAPPE_VERSION} --skip-redis-config-generation --verbose --skip-assets /home/frappe/frappe-bench
WORKDIR /home/frappe/frappe-bench
# Comment following if ERPNext is not required
RUN bench get-app --branch=${ERPNEXT_VERSION} --skip-assets --resolve-deps erpnext
# Copy custom app(s)
COPY --chown=frappe:frappe . apps/${APP_NAME}
# Setup dependencies
RUN bench setup requirements
# Build static assets, copy files instead of symlink
RUN bench build --production --verbose --hard-link
FROM frappe/erpnext-nginx:${ERPNEXT_VERSION}
# Use frappe-nginx image with nginx template and env vars
FROM frappe/frappe-nginx:${FRAPPE_VERSION}
COPY --from=assets /out /usr/share/nginx/html
# Remove existing assets
USER root
RUN rm -fr /usr/share/nginx/html/assets
# Copy built assets
COPY --from=assets /home/frappe/frappe-bench/sites/assets /usr/share/nginx/html/assets
# Use non-root user
USER 1000