mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-08 22:31:07 +00:00
ec584ba9c8
* feat: remove assets-builder image * ci: remove version 12 builds * fix: v13 nginx builds
38 lines
1.0 KiB
Docker
38 lines
1.0 KiB
Docker
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
|
|
|
|
# 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
|
|
|
|
|
|
# Use frappe-nginx image with nginx template and env vars
|
|
FROM frappe/frappe-nginx:${FRAPPE_VERSION}
|
|
|
|
# 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
|