2020-02-10 08:00:54 +00:00
|
|
|
FROM node:slim
|
|
|
|
|
|
|
|
# Install needed packages
|
|
|
|
RUN apt-get update && apt-get install -y curl && apt-get clean
|
|
|
|
|
|
|
|
RUN useradd -ms /bin/bash frappe
|
|
|
|
|
|
|
|
# Make bench directories
|
|
|
|
RUN mkdir -p /home/frappe/frappe-bench/sites /home/frappe/frappe-bench/apps/frappe
|
|
|
|
|
2020-02-20 12:31:23 +00:00
|
|
|
COPY build/frappe-socketio/package.json /home/frappe/frappe-bench/apps/frappe
|
2020-02-10 08:00:54 +00:00
|
|
|
|
|
|
|
|
|
|
|
# get socketio
|
|
|
|
RUN cd /home/frappe/frappe-bench/apps/frappe \
|
|
|
|
&& curl https://raw.githubusercontent.com/frappe/frappe/version-12/socketio.js \
|
|
|
|
--output /home/frappe/frappe-bench/apps/frappe/socketio.js \
|
|
|
|
&& curl https://raw.githubusercontent.com/frappe/frappe/version-12/node_utils.js \
|
|
|
|
--output /home/frappe/frappe-bench/apps/frappe/node_utils.js
|
|
|
|
|
|
|
|
RUN cd /home/frappe/frappe-bench/apps/frappe \
|
2020-03-09 13:39:28 +00:00
|
|
|
&& npm install --only=production \
|
|
|
|
&& node --version \
|
|
|
|
&& npm --version
|
2020-02-10 08:00:54 +00:00
|
|
|
|
2020-02-20 12:31:23 +00:00
|
|
|
COPY build/frappe-socketio/health.js /home/frappe/frappe-bench/apps/frappe/health.js
|
2020-02-10 08:00:54 +00:00
|
|
|
RUN chown -R frappe:frappe /home/frappe
|
|
|
|
|
|
|
|
# Setup docker-entrypoint
|
2020-02-20 12:31:23 +00:00
|
|
|
COPY build/frappe-socketio/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
2020-02-10 08:00:54 +00:00
|
|
|
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
|
|
|
|
|
|
|
|
WORKDIR /home/frappe/frappe-bench/sites
|
|
|
|
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
|
|
CMD ["start"]
|