mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-04-01 10:13:38 -04:00
use meshcentral files from local repository instead of the npm module
This commit is contained in:
parent
47fe130039
commit
118044bcf3
9
.dockerignore
Normal file
9
.dockerignore
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
.github/
|
||||||
|
.vscode/
|
||||||
|
docs/
|
||||||
|
.gitignore
|
||||||
|
.gitlab-ci.yml
|
||||||
|
*.bat
|
||||||
|
*.sln
|
||||||
|
*.njsproj
|
||||||
|
*.md
|
@ -5,17 +5,30 @@ FROM node:slim
|
|||||||
#Add non-root user, add installation directories and assign proper permissions
|
#Add non-root user, add installation directories and assign proper permissions
|
||||||
RUN mkdir -p /opt/meshcentral
|
RUN mkdir -p /opt/meshcentral
|
||||||
|
|
||||||
#meshcentral installation
|
# meshcentral installation
|
||||||
WORKDIR /opt/meshcentral
|
WORKDIR /opt/meshcentral
|
||||||
|
|
||||||
RUN npm install meshcentral
|
|
||||||
|
|
||||||
#Install dependencies for plugins
|
|
||||||
RUN npm install nedb
|
|
||||||
|
|
||||||
COPY config.json.template /opt/meshcentral/config.json.template
|
RUN mkdir /opt/meshcentral/meshcentral
|
||||||
COPY startup.sh startup.sh
|
COPY ./ /opt/meshcentral/meshcentral/
|
||||||
#environment variables
|
COPY ./docker/config.json.template /opt/meshcentral/config.json.template
|
||||||
|
COPY ./docker/startup.sh startup.sh
|
||||||
|
RUN rm -rf ./docker
|
||||||
|
|
||||||
|
# install dependencies from package.json
|
||||||
|
RUN cd meshcentral && npm install
|
||||||
|
|
||||||
|
# install dependencies for plugins
|
||||||
|
RUN cd meshcentral && npm install nedb
|
||||||
|
|
||||||
|
# minify files - first try throws Error: Cannot find module 'jsdom'
|
||||||
|
RUN cd meshcentral/translate && node translate.js minifyall; exit 0
|
||||||
|
RUN cd meshcentral/translate && node translate.js minifyall
|
||||||
|
|
||||||
|
# translate
|
||||||
|
RUN cd meshcentral/translate && node translate.js translateall
|
||||||
|
RUN cd meshcentral/translate && node translate.js extractall
|
||||||
|
|
||||||
EXPOSE 80 443
|
EXPOSE 80 443
|
||||||
|
|
||||||
@ -23,4 +36,4 @@ EXPOSE 80 443
|
|||||||
VOLUME /opt/meshcentral/meshcentral-data
|
VOLUME /opt/meshcentral/meshcentral-data
|
||||||
VOLUME /opt/meshcentral/meshcentral-files
|
VOLUME /opt/meshcentral/meshcentral-files
|
||||||
|
|
||||||
CMD ["bash","/opt/meshcentral/startup.sh"]
|
CMD ["bash", "/opt/meshcentral/startup.sh"]
|
||||||
|
@ -11,7 +11,7 @@ export WEBRTC
|
|||||||
|
|
||||||
if [ -f "meshcentral-data/config.json" ]
|
if [ -f "meshcentral-data/config.json" ]
|
||||||
then
|
then
|
||||||
node node_modules/meshcentral
|
node meshcentral/meshcentral
|
||||||
else
|
else
|
||||||
cp config.json.template meshcentral-data/config.json
|
cp config.json.template meshcentral-data/config.json
|
||||||
sed -i "s/\"cert\": \"myserver.mydomain.com\"/\"cert\": \"$HOSTNAME\"/" meshcentral-data/config.json
|
sed -i "s/\"cert\": \"myserver.mydomain.com\"/\"cert\": \"$HOSTNAME\"/" meshcentral-data/config.json
|
||||||
@ -21,11 +21,10 @@ if [ -f "meshcentral-data/config.json" ]
|
|||||||
sed -i "s/\"minify\": true/\"minify\": \"$MINIFY\"/" meshcentral-data/config.json
|
sed -i "s/\"minify\": true/\"minify\": \"$MINIFY\"/" meshcentral-data/config.json
|
||||||
sed -i "s/\"WebRTC\": false/\"WebRTC\": \"$WEBRTC\"/" meshcentral-data/config.json
|
sed -i "s/\"WebRTC\": false/\"WebRTC\": \"$WEBRTC\"/" meshcentral-data/config.json
|
||||||
sed -i "s/\"AllowFraming\": false/\"AllowFraming\": \"$IFRAME\"/" meshcentral-data/config.json
|
sed -i "s/\"AllowFraming\": false/\"AllowFraming\": \"$IFRAME\"/" meshcentral-data/config.json
|
||||||
if [ "$REVERSE_PROXY" != "false" ]
|
if [ "$REVERSE_PROXY" != "false" ]; then
|
||||||
then
|
sed -i "s/\"_certUrl\": \"my\.reverse\.proxy\"/\"certUrl\": \"https:\/\/$REVERSE_PROXY:$REVERSE_PROXY_TLS_PORT\"/" meshcentral-data/config.json
|
||||||
sed -i "s/\"_certUrl\": \"my\.reverse\.proxy\"/\"certUrl\": \"https:\/\/$REVERSE_PROXY:$REVERSE_PROXY_TLS_PORT\"/" meshcentral-data/config.json
|
node meshcentral/meshcentral
|
||||||
node node_modules/meshcentral
|
exit
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
node node_modules/meshcentral --cert "$HOSTNAME"
|
node meshcentral/meshcentral --cert "$HOSTNAME"
|
||||||
fi
|
fi
|
Loading…
x
Reference in New Issue
Block a user