mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-12-24 19:10:25 +00:00
35 lines
1.3 KiB
Docker
35 lines
1.3 KiB
Docker
FROM node:slim
|
|
|
|
# Add frappe user
|
|
RUN useradd -ms /bin/bash frappe
|
|
|
|
# Create bench directories and set ownership
|
|
RUN mkdir -p /home/frappe/frappe-bench/sites /home/frappe/frappe-bench/apps/frappe \
|
|
&& chown -R frappe:frappe /home/frappe
|
|
|
|
# Download socketio and purge curl package
|
|
COPY build/frappe-socketio/package.json /home/frappe/frappe-bench/apps/frappe
|
|
ARG GIT_BRANCH=develop
|
|
RUN apt-get update && apt-get install -y curl \
|
|
&& cd /home/frappe/frappe-bench/apps/frappe \
|
|
&& curl "https://raw.githubusercontent.com/frappe/frappe/$GIT_BRANCH/socketio.js" \
|
|
--output /home/frappe/frappe-bench/apps/frappe/socketio.js \
|
|
&& curl "https://raw.githubusercontent.com/frappe/frappe/$GIT_BRANCH/node_utils.js" \
|
|
--output /home/frappe/frappe-bench/apps/frappe/node_utils.js \
|
|
&& apt-get purge -y curl && apt-get autoremove -y \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN cd /home/frappe/frappe-bench/apps/frappe \
|
|
&& npm install --only=production \
|
|
&& node --version \
|
|
&& npm --version
|
|
|
|
# Setup docker-entrypoint
|
|
COPY build/frappe-socketio/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
RUN ln -s /usr/local/bin/docker-entrypoint.sh / # backwards compat
|
|
|
|
WORKDIR /home/frappe/frappe-bench/sites
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
CMD ["start"]
|