forked from CIT/Vmeda.Online
		
	Merge pull request #1763 from andrewnicols/docker
MOBILE-2837 Docker: Add a Dockerfile for easier testing and CI
This commit is contained in:
		
						commit
						f31a1f0c69
					
				
							
								
								
									
										2
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,2 @@ | |||||||
|  | node_modules | ||||||
|  | Dockerfile | ||||||
							
								
								
									
										27
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,27 @@ | |||||||
|  | # This image is based on the fat node 11 image. | ||||||
|  | # We require fat images as neither alpine, or slim, include git binaries. | ||||||
|  | FROM node:11 | ||||||
|  | 
 | ||||||
|  | # Port 8100 for ionic dev server. | ||||||
|  | EXPOSE 8100 | ||||||
|  | 
 | ||||||
|  | # Port 35729 is the live-reload server. | ||||||
|  | EXPOSE 35729 | ||||||
|  | 
 | ||||||
|  | # Port 53703 is the Chrome dev logger port. | ||||||
|  | EXPOSE 53703 | ||||||
|  | 
 | ||||||
|  | # MoodleMobile uses Cordova, Ionic, and Gulp. | ||||||
|  | RUN npm install -g cordova ionic gulp && rm -rf /root/.npm | ||||||
|  | 
 | ||||||
|  | WORKDIR /app | ||||||
|  | 
 | ||||||
|  | COPY . /app | ||||||
|  | 
 | ||||||
|  | # The setup script will handle npm installation, cordova setup, and gulp setup. | ||||||
|  | RUN npm run setup && rm -rf /root/.npm | ||||||
|  | 
 | ||||||
|  | # Provide a Healthcheck command for easier use in CI. | ||||||
|  | HEALTHCHECK --interval=10s --timeout=3s --start-period=30s CMD curl -f http://localhost:8100 || exit 1 | ||||||
|  | 
 | ||||||
|  | CMD ["ionic", "serve", "-b"] | ||||||
							
								
								
									
										18
									
								
								hooks/post_push
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								hooks/post_push
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,18 @@ | |||||||
|  | #!/bin/bash | ||||||
|  | 
 | ||||||
|  | set -e | ||||||
|  | 
 | ||||||
|  | if [ "integration" != "${SOURCE_BRANCH}" ] | ||||||
|  | then | ||||||
|  |     # A space-separated list of additional tags to place on this image. | ||||||
|  |     additionalTags=(latest) | ||||||
|  | 
 | ||||||
|  |     # Tag and push image for each additional tag | ||||||
|  |     for tag in ${additionalTags[@]}; do | ||||||
|  |         echo "Tagging {$IMAGE_NAME} as ${DOCKER_REPO}:${tag}" | ||||||
|  |         docker tag $IMAGE_NAME ${DOCKER_REPO}:${tag} | ||||||
|  | 
 | ||||||
|  |         echo "Pushing ${DOCKER_REPO}:${tag}" | ||||||
|  |         docker push ${DOCKER_REPO}:${tag} | ||||||
|  |     done | ||||||
|  | fi | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user