mirror of
https://github.com/frappe/frappe_docker.git
synced 2024-11-08 14:21:05 +00:00
Update frappe-socketio
This commit is contained in:
parent
3f65e95127
commit
11e276b0e9
@ -1,35 +1,23 @@
|
|||||||
FROM alpine/git as builder
|
FROM alpine/git as builder
|
||||||
|
|
||||||
ARG GIT_REPO=https://github.com/frappe/frappe.git
|
ARG FRAPPE_VERSION
|
||||||
ARG GIT_BRANCH=develop
|
RUN git clone --depth 1 -b ${FRAPPE_VERSION} https://github.com/frappe/frappe /opt/frappe
|
||||||
|
|
||||||
RUN git clone --depth 1 -b ${GIT_BRANCH} ${GIT_REPO} /opt/frappe
|
FROM node:17-alpine
|
||||||
|
|
||||||
FROM node:bullseye-slim
|
RUN addgroup -S frappe \
|
||||||
|
&& adduser -S frappe -G frappe
|
||||||
|
USER frappe
|
||||||
|
|
||||||
# Add frappe user
|
|
||||||
RUN useradd -ms /bin/bash frappe
|
|
||||||
WORKDIR /home/frappe/frappe-bench
|
WORKDIR /home/frappe/frappe-bench
|
||||||
|
RUN mkdir -p sites apps/frappe
|
||||||
|
|
||||||
# Create bench directories and set ownership
|
COPY --from=builder /opt/frappe/socketio.js /opt/frappe/node_utils.js apps/frappe/
|
||||||
RUN mkdir -p sites apps/frappe \
|
COPY package.json apps/frappe/
|
||||||
&& chown -R frappe:frappe /home/frappe
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
RUN cd apps/frappe \
|
RUN cd apps/frappe \
|
||||||
&& npm install --only=prod
|
&& npm install
|
||||||
|
|
||||||
# Setup docker-entrypoint
|
|
||||||
COPY build/frappe-socketio/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
|
||||||
# backwards compat
|
|
||||||
RUN ln -s /usr/local/bin/docker-entrypoint.sh /
|
|
||||||
|
|
||||||
USER frappe
|
|
||||||
WORKDIR /home/frappe/frappe-bench/sites
|
WORKDIR /home/frappe/frappe-bench/sites
|
||||||
|
|
||||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
CMD [ "node", "/home/frappe/frappe-bench/apps/frappe/socketio.js" ]
|
||||||
CMD ["start"]
|
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
function checkConfigExists() {
|
|
||||||
COUNTER=0
|
|
||||||
while [[ ! -e /home/frappe/frappe-bench/sites/common_site_config.json && ${COUNTER} -le 30 ]]; do
|
|
||||||
sleep 1
|
|
||||||
((COUNTER = COUNTER + 1))
|
|
||||||
echo "config file not created, retry ${COUNTER}" >&2
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ ! -e /home/frappe/frappe-bench/sites/common_site_config.json ]]; then
|
|
||||||
echo "timeout: config file not created" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
if [[ "$1" == 'start' ]]; then
|
|
||||||
checkConfigExists
|
|
||||||
node /home/frappe/frappe-bench/apps/frappe/socketio.js
|
|
||||||
else
|
|
||||||
exec -c "$@"
|
|
||||||
fi
|
|
@ -2,10 +2,6 @@
|
|||||||
"name": "frappe-socketio",
|
"name": "frappe-socketio",
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"description": "Frappe SocketIO Server",
|
"description": "Frappe SocketIO Server",
|
||||||
"main": "socketio.js",
|
|
||||||
"scripts": {
|
|
||||||
"start": "node socketio.js"
|
|
||||||
},
|
|
||||||
"author": "Revant Nandgaonkar",
|
"author": "Revant Nandgaonkar",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
Loading…
Reference in New Issue
Block a user