Add docker files
This commit is contained in:
		
							parent
							
								
									e2045d31d6
								
							
						
					
					
						commit
						c3b185b592
					
				
					 3 changed files with 43 additions and 0 deletions
				
			
		
							
								
								
									
										13
									
								
								.dockerignore
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								.dockerignore
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,13 @@
 | 
				
			||||||
 | 
					/target
 | 
				
			||||||
 | 
					/out
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/.env
 | 
				
			||||||
 | 
					/api.http
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/emgauwa-*.sqlite
 | 
				
			||||||
 | 
					/emgauwa-*.sqlite-*
 | 
				
			||||||
 | 
					/emgauwa-*.json
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/.dockerignore
 | 
				
			||||||
 | 
					/Dockerfile
 | 
				
			||||||
 | 
					/docker-bake.hcl
 | 
				
			||||||
							
								
								
									
										15
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								Dockerfile
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,15 @@
 | 
				
			||||||
 | 
					FROM rust:1 as builder
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					RUN rustup target add x86_64-unknown-linux-musl && \
 | 
				
			||||||
 | 
					    apt update && \
 | 
				
			||||||
 | 
					    apt install -y musl-tools musl-dev && \
 | 
				
			||||||
 | 
					    update-ca-certificates
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					COPY ./ /emgauwa
 | 
				
			||||||
 | 
					WORKDIR /emgauwa
 | 
				
			||||||
 | 
					RUN cargo build --target x86_64-unknown-linux-musl --release
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					FROM scratch
 | 
				
			||||||
 | 
					COPY --from=builder /emgauwa/target/x86_64-unknown-linux-musl/release/emgauwa-controller /usr/bin/emgauwa-controller
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					CMD ["/usr/bin/emgauwa-controller"]
 | 
				
			||||||
							
								
								
									
										15
									
								
								docker-bake.hcl
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								docker-bake.hcl
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
					@ -0,0 +1,15 @@
 | 
				
			||||||
 | 
					variable "REG" {
 | 
				
			||||||
 | 
					    default = "registry.serguzim.me"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					variable "REPO" {
 | 
				
			||||||
 | 
					    default = "emgauwa/controller"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					variable "TAG" {
 | 
				
			||||||
 | 
					    default = "latest"
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					target "default" {
 | 
				
			||||||
 | 
					    output = ["type=docker"]
 | 
				
			||||||
 | 
					    dockerfile = "./Dockerfile"
 | 
				
			||||||
 | 
					    tags = ["${REG}/${REPO}:latest", "${REG}/${REPO}:${TAG}"]
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue