mirror of
				https://github.com/KevinMidboe/planetposen-images.git
				synced 2025-10-29 13:20:11 +00:00 
			
		
		
		
	Dockerfile and drone config for build & publish to ghcr
This commit is contained in:
		
							
								
								
									
										39
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										39
									
								
								.drone.yml
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,39 @@ | |||||||
|  | --- | ||||||
|  | kind: pipeline | ||||||
|  | type: docker | ||||||
|  | name: Build and publish | ||||||
|  |  | ||||||
|  | platform: | ||||||
|  |   os: linux | ||||||
|  |   arch: amd64 | ||||||
|  |  | ||||||
|  | steps: | ||||||
|  |   - name: build | ||||||
|  |     image: golang | ||||||
|  |     commands: | ||||||
|  |       - make build | ||||||
|  |  | ||||||
|  |   - name: Build and publish docker image | ||||||
|  |     image: plugins/docker | ||||||
|  |     settings: | ||||||
|  |       registry: ghcr.io | ||||||
|  |       repo: ghcr.io/kevinmidboe/planetposen-images | ||||||
|  |       dockerfile: Dockerfile | ||||||
|  |       username: | ||||||
|  |         from_secret: GITHUB_USERNAME | ||||||
|  |       password: | ||||||
|  |         from_secret: GITHUB_PASSWORD | ||||||
|  |       tags: latest | ||||||
|  |     when: | ||||||
|  |       event: | ||||||
|  |         include: | ||||||
|  |           - push | ||||||
|  |         exclude: | ||||||
|  |           - pull_request | ||||||
|  |       branch: | ||||||
|  |         - main | ||||||
|  |         - feat/drone-ci-setup | ||||||
|  |  | ||||||
|  | --- | ||||||
|  | kind: signature | ||||||
|  | hmac: 13d584e973017ab053c389c87d797deb78ea0c85c348446c7e5c1e3e8a174bc3 | ||||||
							
								
								
									
										21
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										21
									
								
								Dockerfile
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,21 @@ | |||||||
|  | # Build the project | ||||||
|  | FROM golang:1.19 as builder | ||||||
|  |  | ||||||
|  | LABEL org.opencontainers.image.source="https://github.com/KevinMidboe/planetposen-images" | ||||||
|  |  | ||||||
|  | WORKDIR /go/src/github.com/kevinmidboe/planetposen-images | ||||||
|  | ADD . . | ||||||
|  |  | ||||||
|  | RUN make build | ||||||
|  | # RUN make test | ||||||
|  |  | ||||||
|  | # Create production image for application with needed files | ||||||
|  | FROM golang:1.19-alpine | ||||||
|  |  | ||||||
|  | EXPOSE 8000 | ||||||
|  |  | ||||||
|  | RUN apk add --no-cache ca-certificates | ||||||
|  |  | ||||||
|  | COPY --from=builder /go/src/github.com/kevinmidboe/planetposen-images . | ||||||
|  |  | ||||||
|  | CMD ["./main"] | ||||||
		Reference in New Issue
	
	Block a user