2020-08-07 09:58:15 +00:00
|
|
|
# This image uses nvm and same base image as the worker image.
|
|
|
|
# This is done to ensures that node-sass binary remains common.
|
|
|
|
# node-sass is required to enable website theme feature used
|
|
|
|
# by Website Manager role in Frappe Framework
|
2021-01-08 12:15:22 +00:00
|
|
|
FROM python:3.7-slim-buster
|
2020-08-06 17:08:52 +00:00
|
|
|
|
2021-05-21 09:00:55 +00:00
|
|
|
ARG GIT_REPO=https://github.com/frappe/frappe
|
|
|
|
ARG GIT_BRANCH=develop
|
|
|
|
|
2020-08-06 17:08:52 +00:00
|
|
|
ENV NVM_DIR=/root/.nvm
|
2021-05-21 09:00:55 +00:00
|
|
|
ENV NODE_VERSION=14.17.0
|
2020-08-06 17:08:52 +00:00
|
|
|
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
|
2021-01-08 12:15:22 +00:00
|
|
|
RUN apt-get update -y \
|
|
|
|
&& apt-get install wget python2 git build-essential -y \
|
|
|
|
&& apt-get clean \
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2021-05-21 09:00:55 +00:00
|
|
|
&& wget https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh \
|
2020-08-06 17:08:52 +00:00
|
|
|
&& chmod +x install.sh \
|
|
|
|
&& ./install.sh \
|
|
|
|
&& . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION} \
|
|
|
|
&& nvm use v${NODE_VERSION} && npm install -g yarn
|
2020-02-17 15:05:50 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
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 \
|
2021-05-21 09:00:55 +00:00
|
|
|
&& git clone --depth 1 ${GIT_REPO} --branch $GIT_BRANCH
|
2020-02-17 15:05:50 +00:00
|
|
|
|
2020-10-02 00:41:46 +00:00
|
|
|
RUN cd /home/frappe/frappe-bench/apps/frappe \
|
|
|
|
&& yarn \
|
|
|
|
&& yarn run production \
|
|
|
|
&& yarn install --production=true
|
|
|
|
|
2020-06-27 18:14:13 +00:00
|
|
|
RUN node --version \
|
2020-03-09 23:37:25 +00:00
|
|
|
&& 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
|
|
|
|
|
2021-02-03 05:52:52 +00:00
|
|
|
RUN mkdir -p /home/frappe/frappe-bench/sites/assets/frappe/ \
|
|
|
|
&& cp -R /home/frappe/frappe-bench/apps/frappe/frappe/public/* /home/frappe/frappe-bench/sites/assets/frappe \
|
2020-02-17 15:05:50 +00:00
|
|
|
&& 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 \
|
2021-08-10 11:16:46 +00:00
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
2020-03-19 23:51:30 +00:00
|
|
|
&& 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;"]
|