2020-02-17 15:05:50 +00:00
|
|
|
FROM bitnami/node:12-prod
|
|
|
|
|
|
|
|
WORKDIR /home/frappe/frappe-bench
|
2020-02-20 12:31:23 +00:00
|
|
|
RUN mkdir -p /home/frappe/frappe-bench/sites \
|
|
|
|
&& echo "frappe" > /home/frappe/frappe-bench/sites/apps.txt
|
2020-02-17 15:05:50 +00:00
|
|
|
|
|
|
|
RUN install_packages git
|
|
|
|
|
2020-04-23 09:26:46 +00:00
|
|
|
RUN mkdir -p apps sites/assets/css \
|
2020-02-17 15:05:50 +00:00
|
|
|
&& cd apps \
|
|
|
|
&& git clone --depth 1 https://github.com/frappe/frappe
|
|
|
|
|
2020-04-23 09:26:46 +00:00
|
|
|
COPY build/frappe-nginx/generate_standard_style_css.js \
|
|
|
|
/home/frappe/frappe-bench/apps/frappe/generate_standard_style_css.js
|
|
|
|
|
2020-02-17 15:05:50 +00:00
|
|
|
RUN cd /home/frappe/frappe-bench/apps/frappe \
|
|
|
|
&& yarn \
|
|
|
|
&& yarn run production \
|
2020-04-23 09:26:46 +00:00
|
|
|
&& yarn add nunjucks -D \
|
|
|
|
&& node generate_standard_style_css.js \
|
|
|
|
frappe/website/doctype/website_theme/website_theme_template.scss > \
|
|
|
|
/home/frappe/standard_templates_string \
|
|
|
|
&& node generate_bootstrap_theme.js \
|
|
|
|
/home/frappe/frappe-bench/sites/assets/css/standard_style.css \
|
|
|
|
"$(cat /home/frappe/standard_templates_string)" \
|
2020-02-17 15:05:50 +00:00
|
|
|
&& rm -fr node_modules \
|
2020-03-09 23:37:25 +00:00
|
|
|
&& yarn install --production=true \
|
|
|
|
&& node --version \
|
|
|
|
&& npm --version \
|
|
|
|
&& yarn --version
|
2020-02-17 15:05:50 +00:00
|
|
|
|
|
|
|
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 /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/
|
|
|
|
|
|
|
|
FROM nginx:latest
|
|
|
|
COPY --from=0 /home/frappe/frappe-bench/sites /var/www/html/
|
|
|
|
COPY --from=0 /var/www/error_pages /var/www/
|
2020-02-20 12:31:23 +00:00
|
|
|
COPY build/common/nginx-default.conf.template /etc/nginx/conf.d/default.conf.template
|
2020-03-03 23:40:11 +00:00
|
|
|
COPY build/frappe-nginx/docker-entrypoint.sh /
|
2020-02-17 15:05:50 +00:00
|
|
|
|
2020-03-19 23:51:30 +00:00
|
|
|
RUN apt-get update && apt-get install -y rsync && apt-get clean \
|
|
|
|
&& echo "#!/bin/bash" > /rsync \
|
|
|
|
&& chmod +x /rsync
|
2020-02-17 15:05:50 +00:00
|
|
|
|
|
|
|
VOLUME [ "/assets" ]
|
|
|
|
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|