2
0
mirror of https://github.com/frappe/frappe_docker.git synced 2024-11-08 06:15:26 +00:00

fix(frappe-socketio): use package.json from frappe repo (#996)

fixes #994
This commit is contained in:
Revant Nandgaonkar 2022-11-05 14:43:33 +05:30 committed by GitHub
parent 3661059667
commit 63902fd427
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 18 deletions

View File

@ -2,10 +2,20 @@ FROM alpine/git as builder
ARG FRAPPE_VERSION
ARG FRAPPE_REPO=https://github.com/frappe/frappe
RUN apk add -U jq
RUN git clone --depth 1 -b ${FRAPPE_VERSION} ${FRAPPE_REPO} /opt/frappe
RUN jq --argjson dependencies "$(jq '.dependencies | INDEX( "express", "redis", "socket.io", "superagent" ) as $keep | \
del( \
. | objects | \
.[ \
keys_unsorted[] | \
select( $keep[ . ] | not ) \
] \
)' /opt/frappe/package.json)" '.dependencies = $dependencies | del(.scripts.prepare)' /opt/frappe/package.json > /opt/frappe/dependencies.json && \
mv /opt/frappe/dependencies.json /opt/frappe/package.json
FROM node:17-alpine
# NodeJS LTS
FROM node:18-alpine
RUN addgroup -S frappe \
&& adduser -S frappe -G frappe
@ -14,11 +24,10 @@ USER frappe
WORKDIR /home/frappe/frappe-bench
RUN mkdir -p sites apps/frappe
COPY --chown=frappe:frappe --from=builder /opt/frappe/socketio.js /opt/frappe/node_utils.js apps/frappe/
COPY --chown=frappe:frappe package.json apps/frappe/
COPY --chown=frappe:frappe --from=builder /opt/frappe/package.json /opt/frappe/socketio.js /opt/frappe/node_utils.js apps/frappe/
RUN cd apps/frappe \
&& npm install
&& npm install --omit=dev
WORKDIR /home/frappe/frappe-bench/sites

View File

@ -1,13 +0,0 @@
{
"name": "frappe-socketio",
"version": "1.0.1",
"description": "Frappe SocketIO Server",
"author": "Revant Nandgaonkar",
"license": "MIT",
"dependencies": {
"express": "^4.17.1",
"redis": "^3.1.1",
"socket.io": "^2.4.0",
"superagent": "^5.1.0"
}
}