mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-11-07 12:52:54 -05:00
add docker release action
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
FROM node:current-alpine AS base
|
||||
|
||||
#Add non-root user, add installation directories and assign proper permissions
|
||||
RUN mkdir -p /opt/meshcentral
|
||||
RUN mkdir -p /opt/meshcentral/meshcentral
|
||||
|
||||
# meshcentral installation
|
||||
WORKDIR /opt/meshcentral
|
||||
WORKDIR /opt/meshcentral/meshcentral
|
||||
|
||||
RUN apk add --no-cache bash
|
||||
|
||||
@@ -14,7 +14,6 @@ FROM base AS builder
|
||||
ARG DISABLE_MINIFY=""
|
||||
ARG DISABLE_TRANSLATE=""
|
||||
|
||||
RUN mkdir /opt/meshcentral/meshcentral
|
||||
COPY ./ /opt/meshcentral/meshcentral/
|
||||
|
||||
RUN if ! [ -z "$DISABLE_MINIFY" ] && [ "$DISABLE_MINIFY" != "yes" ] && [ "$DISABLE_MINIFY" != "YES" ] \
|
||||
@@ -26,15 +25,14 @@ RUN if ! [ -z "$DISABLE_TRANSLATE" ] && [ "$DISABLE_TRANSLATE" != "yes" ] && [ "
|
||||
echo -e "\e[0;31;49mInvalid value for build argument DISABLE_TRANSLATE, possible values: yes/true\e[;0m"; exit 1; \
|
||||
fi
|
||||
|
||||
# first try throws Error: Cannot find module 'jsdom'
|
||||
RUN if [ -z "$DISABLE_MINIFY" ] || [ -z "$DISABLE_TRANSLATE" ]; then cd meshcentral/translate && node translate.js extractall; exit 0; fi
|
||||
# first extractall if need too
|
||||
RUN if [ -z "$DISABLE_MINIFY" ] || [ -z "$DISABLE_TRANSLATE" ]; then npm install html-minifier jsdom minify-js && cd translate && node translate.js extractall; fi
|
||||
|
||||
# minify files
|
||||
RUN if [ -z "$DISABLE_MINIFY" ]; then cd meshcentral/translate && node translate.js minifyall; fi
|
||||
RUN if [ -z "$DISABLE_MINIFY" ]; then cd translate && node translate.js minifyall; fi
|
||||
|
||||
# translate
|
||||
RUN if [ -z "$DISABLE_TRANSLATE" ]; then cd meshcentral/translate && node translate.js extractall; fi
|
||||
RUN if [ -z "$DISABLE_TRANSLATE" ]; then cd meshcentral/translate && node translate.js translateall; fi
|
||||
RUN if [ -z "$DISABLE_TRANSLATE" ]; then cd translate && node translate.js translateall; fi
|
||||
|
||||
|
||||
FROM base
|
||||
@@ -56,11 +54,8 @@ COPY --from=builder /opt/meshcentral/meshcentral/docker/config.json.template /op
|
||||
RUN rm -rf /opt/meshcentral/meshcentral/docker
|
||||
RUN rm -rf /opt/meshcentral/meshcentral/node_modules
|
||||
|
||||
# install dependencies from package.json
|
||||
RUN cd meshcentral && npm install
|
||||
|
||||
# install dependencies for plugins
|
||||
RUN cd meshcentral && npm install nedb
|
||||
# install dependencies from package.json and nedb
|
||||
RUN cd meshcentral && npm install && npm install nedb
|
||||
|
||||
EXPOSE 80 443 4433
|
||||
|
||||
|
||||
Reference in New Issue
Block a user