mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-12-23 10:38:58 +00:00
create install_app for assets
This commit is contained in:
parent
b610caba7e
commit
f4e24e15a8
@ -1,38 +1,14 @@
|
||||
FROM bitnami/node:12-prod
|
||||
|
||||
WORKDIR /home/frappe/frappe-bench
|
||||
RUN mkdir -p /home/frappe/frappe-bench/sites \
|
||||
&& echo "frappe\nerpnext" > /home/frappe/frappe-bench/sites/apps.txt
|
||||
COPY build/erpnext-assets/install_app.sh /install_app
|
||||
|
||||
RUN install_packages git python2
|
||||
RUN /install_app erpnext https://github.com/frappe/erpnext
|
||||
|
||||
RUN mkdir -p apps sites/assets \
|
||||
&& cd apps \
|
||||
&& git clone --depth 1 https://github.com/frappe/frappe \
|
||||
&& git clone --depth 1 https://github.com/frappe/erpnext
|
||||
|
||||
RUN cd /home/frappe/frappe-bench/apps/frappe \
|
||||
&& yarn \
|
||||
&& yarn run production \
|
||||
&& rm -fr node_modules \
|
||||
&& yarn install --production=true
|
||||
|
||||
RUN git clone --depth 1 https://github.com/frappe/bench /tmp/bench \
|
||||
&& mkdir -p /var/www/error_pages \
|
||||
&& cp -r /tmp/bench/bench/config/templates/502.html /var/www/error_pages
|
||||
|
||||
RUN cp -R /home/frappe/frappe-bench/apps/frappe/frappe/public/* /home/frappe/frappe-bench/sites/assets/frappe \
|
||||
&& cp -R /home/frappe/frappe-bench/apps/frappe/node_modules /home/frappe/frappe-bench/sites/assets/frappe/ \
|
||||
&& mkdir -p /home/frappe/frappe-bench/sites/assets/erpnext \
|
||||
&& cp -R /home/frappe/frappe-bench/apps/erpnext/erpnext/public/* /home/frappe/frappe-bench/sites/assets/erpnext
|
||||
|
||||
FROM nginx:latest
|
||||
COPY --from=0 /home/frappe/frappe-bench/sites /var/www/html/
|
||||
COPY --from=0 /var/www/error_pages /var/www/
|
||||
COPY build/common/nginx-default.conf.template /etc/nginx/conf.d/default.conf.template
|
||||
COPY build/erpnext-assets/docker-entrypoint.sh /
|
||||
|
||||
RUN apt-get update && apt-get install -y rsync && apt-get clean
|
||||
FROM frappe/frappe-assets:develop
|
||||
RUN cp /home/frappe/frappe-bench/sites/apps.txt /home/frappe/frappe-bench/sites/apps.bak
|
||||
COPY --from=0 /home/frappe/frappe-bench/sites/ /var/www/html/
|
||||
RUN mv /home/frappe/frappe-bench/sites/apps.bak /home/frappe/frappe-bench/sites/apps.txt \
|
||||
&& echo -n "\nerpnext" >> /home/frappe/frappe-bench/sites/apps.txt
|
||||
|
||||
VOLUME [ "/assets" ]
|
||||
|
||||
|
29
build/erpnext-assets/install_app.sh
Normal file
29
build/erpnext-assets/install_app.sh
Normal file
@ -0,0 +1,29 @@
|
||||
#!/bin/bash
|
||||
|
||||
APP_NAME=${1}
|
||||
APP_REPO=${2}
|
||||
APP_BRANCH=${3}
|
||||
|
||||
[ "${APP_BRANCH}" ] && \
|
||||
BRANCH="-b ${APP_BRANCH}"
|
||||
|
||||
cd /home/frappe/frappe-bench
|
||||
mkdir -p /home/frappe/frappe-bench/sites
|
||||
echo "frappe\n${APP_NAME}" > /home/frappe/frappe-bench/sites/apps.txt
|
||||
|
||||
install_packages git python2
|
||||
|
||||
mkdir -p apps sites/assets
|
||||
cd apps
|
||||
git clone --depth 1 https://github.com/frappe/frappe ${BRANCH}
|
||||
git clone --depth 1 ${APP_REPO} ${BRANCH}
|
||||
|
||||
cd /home/frappe/frappe-bench/apps/frappe
|
||||
yarn
|
||||
yarn production
|
||||
rm -fr node_modules
|
||||
yarn install --production=true
|
||||
|
||||
mkdir -p /home/frappe/frappe-bench/sites/assets/${APP_NAME}
|
||||
cp -R /home/frappe/frappe-bench/apps/${APP_NAME}/${APP_NAME}/public/* /home/frappe/frappe-bench/sites/assets/${APP_NAME}
|
||||
|
@ -1,38 +1,14 @@
|
||||
FROM bitnami/node:10-prod
|
||||
|
||||
WORKDIR /home/frappe/frappe-bench
|
||||
RUN mkdir -p /home/frappe/frappe-bench/sites \
|
||||
&& echo "frappe\nerpnext" > /home/frappe/frappe-bench/sites/apps.txt
|
||||
COPY build/erpnext-assets/install_app.sh /install_app
|
||||
|
||||
RUN install_packages git python2
|
||||
RUN /install_app erpnext https://github.com/frappe/erpnext version-11
|
||||
|
||||
RUN mkdir -p apps sites/assets \
|
||||
&& cd apps \
|
||||
&& git clone --depth 1 https://github.com/frappe/frappe --branch version-11 \
|
||||
&& git clone --depth 1 https://github.com/frappe/erpnext --branch version-11
|
||||
|
||||
RUN cd /home/frappe/frappe-bench/apps/frappe \
|
||||
&& yarn \
|
||||
&& yarn run production \
|
||||
&& rm -fr node_modules \
|
||||
&& yarn install --production=true
|
||||
|
||||
RUN git clone --depth 1 https://github.com/frappe/bench /tmp/bench \
|
||||
&& mkdir -p /var/www/error_pages \
|
||||
&& cp -r /tmp/bench/bench/config/templates/502.html /var/www/error_pages
|
||||
|
||||
RUN cp -R /home/frappe/frappe-bench/apps/frappe/frappe/public/* /home/frappe/frappe-bench/sites/assets/frappe \
|
||||
&& cp -R /home/frappe/frappe-bench/apps/frappe/node_modules /home/frappe/frappe-bench/sites/assets/frappe/ \
|
||||
&& mkdir -p /home/frappe/frappe-bench/sites/assets/erpnext \
|
||||
&& cp -R /home/frappe/frappe-bench/apps/erpnext/erpnext/public/* /home/frappe/frappe-bench/sites/assets/erpnext
|
||||
|
||||
FROM nginx:latest
|
||||
COPY --from=0 /home/frappe/frappe-bench/sites /var/www/html/
|
||||
COPY --from=0 /var/www/error_pages /var/www/
|
||||
COPY build/common/nginx-default.conf.template /etc/nginx/conf.d/default.conf.template
|
||||
COPY build/erpnext-assets/docker-entrypoint.sh /
|
||||
|
||||
RUN apt-get update && apt-get install -y rsync && apt-get clean
|
||||
FROM frappe/frappe-assets:v11
|
||||
RUN cp /home/frappe/frappe-bench/sites/apps.txt /home/frappe/frappe-bench/sites/apps.bak
|
||||
COPY --from=0 /home/frappe/frappe-bench/sites/ /var/www/html/
|
||||
RUN mv /home/frappe/frappe-bench/sites/apps.bak /home/frappe/frappe-bench/sites/apps.txt \
|
||||
&& echo -n "\nerpnext" >> /home/frappe/frappe-bench/sites/apps.txt
|
||||
|
||||
VOLUME [ "/assets" ]
|
||||
|
||||
|
@ -1,39 +1,14 @@
|
||||
FROM bitnami/node:12-prod
|
||||
|
||||
WORKDIR /home/frappe/frappe-bench
|
||||
RUN mkdir -p /home/frappe/frappe-bench/sites \
|
||||
&& echo "frappe\nerpnext" > /home/frappe/frappe-bench/sites/apps.txt
|
||||
COPY build/erpnext-assets/install_app.sh /install_app
|
||||
|
||||
RUN install_packages git python2
|
||||
|
||||
RUN mkdir -p apps sites/assets \
|
||||
&& cd apps \
|
||||
&& git clone --depth 1 https://github.com/frappe/frappe --branch version-12 \
|
||||
&& git clone --depth 1 https://github.com/frappe/erpnext --branch version-12
|
||||
|
||||
RUN cd /home/frappe/frappe-bench/apps/frappe \
|
||||
&& yarn \
|
||||
&& yarn run production \
|
||||
&& rm -fr node_modules \
|
||||
&& yarn install --production=true
|
||||
|
||||
RUN git clone --depth 1 https://github.com/frappe/bench /tmp/bench \
|
||||
&& mkdir -p /var/www/error_pages \
|
||||
&& cp -r /tmp/bench/bench/config/templates/502.html /var/www/error_pages
|
||||
|
||||
RUN cp -R /home/frappe/frappe-bench/apps/frappe/frappe/public/* /home/frappe/frappe-bench/sites/assets/frappe \
|
||||
&& cp -R /home/frappe/frappe-bench/apps/frappe/node_modules /home/frappe/frappe-bench/sites/assets/frappe/ \
|
||||
&& mkdir -p /home/frappe/frappe-bench/sites/assets/erpnext \
|
||||
&& cp -R /home/frappe/frappe-bench/apps/erpnext/erpnext/public/* /home/frappe/frappe-bench/sites/assets/erpnext
|
||||
|
||||
FROM nginx:latest
|
||||
COPY --from=0 /home/frappe/frappe-bench/sites /var/www/html/
|
||||
COPY --from=0 /var/www/error_pages /var/www/
|
||||
COPY build/common/nginx-default.conf.template /etc/nginx/conf.d/default.conf.template
|
||||
COPY build/erpnext-assets/docker-entrypoint.sh /
|
||||
|
||||
RUN apt-get update && apt-get install -y rsync && apt-get clean
|
||||
RUN /install_app erpnext https://github.com/frappe/erpnext version-12
|
||||
|
||||
FROM frappe/frappe-assets:v12
|
||||
RUN cp /home/frappe/frappe-bench/sites/apps.txt /home/frappe/frappe-bench/sites/apps.bak
|
||||
COPY --from=0 /home/frappe/frappe-bench/sites/ /var/www/html/
|
||||
RUN mv /home/frappe/frappe-bench/sites/apps.bak /home/frappe/frappe-bench/sites/apps.txt \
|
||||
&& echo -n "\nerpnext" >> /home/frappe/frappe-bench/sites/apps.txt
|
||||
VOLUME [ "/assets" ]
|
||||
|
||||
ENTRYPOINT ["/docker-entrypoint.sh"]
|
||||
|
Loading…
Reference in New Issue
Block a user