mirror of
				https://github.com/dancojocaru2000/CfrTrainInfoTelegramBot.git
				synced 2025-11-04 08:56:39 +02:00 
			
		
		
		
	Add Dockerfile
This commit is contained in:
		
							parent
							
								
									6b3b5bb3c6
								
							
						
					
					
						commit
						938edab3d6
					
				
					 2 changed files with 49 additions and 0 deletions
				
			
		
							
								
								
									
										25
									
								
								.dockerignore
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										25
									
								
								.dockerignore
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,25 @@
 | 
				
			||||||
 | 
					### Go template
 | 
				
			||||||
 | 
					# If you prefer the allow list template instead of the deny list, see community template:
 | 
				
			||||||
 | 
					# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
 | 
				
			||||||
 | 
					#
 | 
				
			||||||
 | 
					# Binaries for programs and plugins
 | 
				
			||||||
 | 
					*.exe
 | 
				
			||||||
 | 
					*.exe~
 | 
				
			||||||
 | 
					*.dll
 | 
				
			||||||
 | 
					*.so
 | 
				
			||||||
 | 
					*.dylib
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Test binary, built with `go test -c`
 | 
				
			||||||
 | 
					*.test
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Output of the go coverage tool, specifically when used with LiteIDE
 | 
				
			||||||
 | 
					*.out
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Dependency directories (remove the comment below to include it)
 | 
				
			||||||
 | 
					# vendor/
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Go workspace file
 | 
				
			||||||
 | 
					go.work
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Also ignore the Dockerfile
 | 
				
			||||||
 | 
					Dockerfile
 | 
				
			||||||
							
								
								
									
										24
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,24 @@
 | 
				
			||||||
 | 
					FROM --platform=$BUILDPLATFORM golang:1.21-alpine AS build
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					LABEL authors="kbruen"
 | 
				
			||||||
 | 
					LABEL org.opencontainers.image.source=https://github.com/dancojocaru2000/CfrTrainInfoTelegramBot
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WORKDIR /app
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY go.mod .
 | 
				
			||||||
 | 
					COPY go.sum .
 | 
				
			||||||
 | 
					RUN go mod download
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY main.go ./
 | 
				
			||||||
 | 
					COPY pkg ./pkg/
 | 
				
			||||||
 | 
					ARG TARGETOS TARGETARCH
 | 
				
			||||||
 | 
					RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o server
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FROM scratch
 | 
				
			||||||
 | 
					COPY --from=build /etc/ssl/certs /etc/ssl/certs
 | 
				
			||||||
 | 
					WORKDIR /app
 | 
				
			||||||
 | 
					# COPY static ./static/
 | 
				
			||||||
 | 
					COPY --from=build /app/server ./
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					ENV DEBUG=false
 | 
				
			||||||
 | 
					ENTRYPOINT [ "/app/server" ]
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue