mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Adding a project-level Dockerfile & docker-compose script
This commit is contained in:
		
							
								
								
									
										17
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,17 @@
 | 
				
			|||||||
 | 
					FROM google/golang:latest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENV TAGS="sqlite redis memcache cert" USER="git" HOME="/home/git"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY  . /gopath/src/github.com/gogits/gogs/
 | 
				
			||||||
 | 
					WORKDIR /gopath/src/github.com/gogits/gogs/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RUN  go get -v -tags="$TAGS" github.com/gogits/gogs \
 | 
				
			||||||
 | 
					  && go build -tags="$TAGS" \
 | 
				
			||||||
 | 
					  && useradd -d $HOME -m $USER \
 | 
				
			||||||
 | 
					  && chown -R $USER .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					USER $USER
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENTRYPOINT [ "./gogs" ]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CMD [ "web" ]
 | 
				
			||||||
							
								
								
									
										12
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								docker-compose.yml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					web:
 | 
				
			||||||
 | 
					  build: .
 | 
				
			||||||
 | 
					  links:
 | 
				
			||||||
 | 
					    - mysql
 | 
				
			||||||
 | 
					  ports:
 | 
				
			||||||
 | 
					    - "3000:3000"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					mysql:
 | 
				
			||||||
 | 
					  image: mysql
 | 
				
			||||||
 | 
					  environment:
 | 
				
			||||||
 | 
					    - MYSQL_ROOT_PASSWORD=gogs
 | 
				
			||||||
 | 
					    - MYSQL_DATABASE=gogs
 | 
				
			||||||
		Reference in New Issue
	
	Block a user