2020-02-10 08:00:54 +00:00
|
|
|
FROM bitnami/node:10-prod
|
|
|
|
|
|
|
|
WORKDIR /home/frappe/frappe-bench
|
2020-02-20 12:31:23 +00:00
|
|
|
RUN mkdir -p /home/frappe/frappe-bench/sites \
|
2020-03-01 10:08:05 +00:00
|
|
|
&& echo "frappe\nerpnext" > /home/frappe/frappe-bench/sites/apps.txt
|
2020-02-10 08:00:54 +00:00
|
|
|
|
2020-03-01 10:08:05 +00:00
|
|
|
RUN install_packages git python2
|
2020-02-10 08:00:54 +00:00
|
|
|
|
|
|
|
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 \
|
2020-02-20 12:31:23 +00:00
|
|
|
&& cp -r /tmp/bench/bench/config/templates/502.html /var/www/error_pages
|
2020-02-10 08:00:54 +00:00
|
|
|
|
|
|
|
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/ \
|
2020-02-20 12:31:23 +00:00
|
|
|
&& mkdir -p /home/frappe/frappe-bench/sites/assets/erpnext \
|
2020-03-01 10:08:05 +00:00
|
|
|
&& cp -R /home/frappe/frappe-bench/apps/erpnext/erpnext/public/* /home/frappe/frappe-bench/sites/assets/erpnext
|
2020-02-10 08:00:54 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
COPY build/erpnext-assets/docker-entrypoint.sh /
|
2020-02-10 08:00:54 +00:00
|
|
|
|
|
|
|
RUN apt-get update && apt-get install -y rsync && apt-get clean
|
|
|
|
|
|
|
|
VOLUME [ "/assets" ]
|
|
|
|
|
|
|
|
ENTRYPOINT ["/docker-entrypoint.sh"]
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|