mirror of
				https://github.com/Ylianst/MeshCentral.git
				synced 2025-03-09 15:40:18 +00:00 
			
		
		
		
	Merge pull request #4086 from sschoen/Feature/docker
changed baseimage to current-alpine and optional installation of mongodb-tools
This commit is contained in:
		
						commit
						ca6288dae9
					
				
					 2 changed files with 8 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
# Filename: Dockerfile
 | 
			
		||||
FROM node:current-alpine
 | 
			
		||||
 | 
			
		||||
FROM node:slim
 | 
			
		||||
ARG INCLUDE_MONGODBTOOLS=""
 | 
			
		||||
 | 
			
		||||
#Add non-root user, add installation directories and assign proper permissions
 | 
			
		||||
RUN mkdir -p /opt/meshcentral
 | 
			
		||||
| 
						 | 
				
			
			@ -8,15 +8,8 @@ RUN mkdir -p /opt/meshcentral
 | 
			
		|||
# meshcentral installation
 | 
			
		||||
WORKDIR /opt/meshcentral
 | 
			
		||||
 | 
			
		||||
# add mongodb repository to apt
 | 
			
		||||
RUN apt-get update && apt-get install -y gnupg2 wget
 | 
			
		||||
RUN wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | apt-key add -
 | 
			
		||||
RUN echo "deb http://repo.mongodb.org/apt/debian buster/mongodb-org/5.0 main" | tee /etc/apt/sources.list.d/mongodb-org-5.0.list
 | 
			
		||||
 | 
			
		||||
# install mongodb
 | 
			
		||||
RUN apt-get update \
 | 
			
		||||
    && apt-get install -y mongodb-org-tools \
 | 
			
		||||
    && rm -rf /var/lib/apt/lists/*
 | 
			
		||||
RUN apk add --no-cache bash
 | 
			
		||||
RUN if [ "$INCLUDE_MONGODBTOOLS" == "yes" ] || [ "$INCLUDE_MONGODBTOOLS" == "YES" ]; then apk add --no-cache mongodb-tools; fi
 | 
			
		||||
 | 
			
		||||
RUN mkdir /opt/meshcentral/meshcentral
 | 
			
		||||
COPY ./ /opt/meshcentral/meshcentral/
 | 
			
		||||
| 
						 | 
				
			
			@ -38,7 +31,7 @@ RUN cd meshcentral/translate && node translate.js minifyall
 | 
			
		|||
RUN cd meshcentral/translate && node translate.js translateall
 | 
			
		||||
RUN cd meshcentral/translate && node translate.js extractall
 | 
			
		||||
 | 
			
		||||
EXPOSE 80 443
 | 
			
		||||
EXPOSE 80 443 4433
 | 
			
		||||
 | 
			
		||||
# volumes
 | 
			
		||||
VOLUME /opt/meshcentral/meshcentral-data
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -7,6 +7,9 @@
 | 
			
		|||
 | 
			
		||||
> docker build -f docker/Dockerfile --force-rm -t meshcentral .
 | 
			
		||||
 | 
			
		||||
# alternative, if you want to include the mongodb-tools (mongodump, ...), you can add the 'INCLUDE_MONGODBTOOLS=yes' build argument
 | 
			
		||||
> docker build -f docker/Dockerfile --force-rm --build-arg INCLUDE_MONGODBTOOLS=yes -t meshcentral .
 | 
			
		||||
 | 
			
		||||
# (optional) cleanup after docker build:
 | 
			
		||||
> cd ..
 | 
			
		||||
> rm -rf MeshCentral/
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue