2021-11-09 23:13:46 +00:00
|
|
|
FROM alpine/git as builder
|
2021-05-21 09:00:55 +00:00
|
|
|
|
|
|
|
ARG GIT_REPO=https://github.com/frappe/frappe.git
|
|
|
|
ARG GIT_BRANCH=develop
|
|
|
|
|
2021-11-09 23:13:46 +00:00
|
|
|
RUN git clone --depth 1 -b ${GIT_BRANCH} ${GIT_REPO} /opt/frappe
|
2021-05-21 09:00:55 +00:00
|
|
|
|
2021-11-03 13:48:01 +00:00
|
|
|
FROM node:bullseye-slim
|
2020-02-10 08:00:54 +00:00
|
|
|
|
2020-06-27 18:14:13 +00:00
|
|
|
# Add frappe user
|
2020-02-10 08:00:54 +00:00
|
|
|
RUN useradd -ms /bin/bash frappe
|
2021-11-09 23:13:46 +00:00
|
|
|
WORKDIR /home/frappe/frappe-bench
|
2020-02-10 08:00:54 +00:00
|
|
|
|
2020-06-27 18:14:13 +00:00
|
|
|
# Create bench directories and set ownership
|
2021-11-09 23:13:46 +00:00
|
|
|
RUN mkdir -p sites apps/frappe \
|
2020-06-27 18:14:13 +00:00
|
|
|
&& chown -R frappe:frappe /home/frappe
|
2020-02-10 08:00:54 +00:00
|
|
|
|
2021-11-09 23:13:46 +00:00
|
|
|
# Download socketio
|
|
|
|
COPY build/frappe-socketio/package.json apps/frappe
|
|
|
|
COPY --from=builder /opt/frappe/socketio.js apps/frappe/socketio.js
|
|
|
|
COPY --from=builder /opt/frappe/node_utils.js apps/frappe/node_utils.js
|
2020-02-10 08:00:54 +00:00
|
|
|
|
2021-11-09 23:13:46 +00:00
|
|
|
RUN cd apps/frappe \
|
|
|
|
&& npm install --only=prod
|
2020-02-10 08:00:54 +00:00
|
|
|
|
|
|
|
# Setup docker-entrypoint
|
2020-02-20 12:31:23 +00:00
|
|
|
COPY build/frappe-socketio/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
2021-11-09 23:13:46 +00:00
|
|
|
# backwards compat
|
|
|
|
RUN ln -s /usr/local/bin/docker-entrypoint.sh /
|
2020-02-10 08:00:54 +00:00
|
|
|
|
2021-02-20 10:54:01 +00:00
|
|
|
USER frappe
|
2020-02-10 08:00:54 +00:00
|
|
|
WORKDIR /home/frappe/frappe-bench/sites
|
|
|
|
|
|
|
|
ENTRYPOINT ["docker-entrypoint.sh"]
|
|
|
|
CMD ["start"]
|