mirror of
				https://github.com/openimsdk/open-im-server.git
				synced 2025-10-26 05:02:11 +08:00 
			
		
		
		
	* build: k8s improve. * refactor: update docker image contents. * rename seq file. * build: update k8s origin deploys. * update check logic. * update magefile * update image name. * update readme * update Kubernetes Discovery. * revert pkg. * update create in k8s * update service image release CI. * update deployment image source. * update mage contents. * update pkg source. * update go get pkg. * fix test file. * update discovery register. * update * update deploy yaml. * update replica. * update deployment. * remove notfication config. * remove notification and zookeeper. * update discovery in kubernetes. * build: improve kubernetes deployment. * update config field in discovery. * update ReadMe in deployments. * update go mod. * update const quote. * fix test fields. * remove unused method. * remove unused contents.
		
			
				
	
	
		
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
			
		
		
	
	
			40 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Docker
		
	
	
	
	
	
| # Use Go 1.22 Alpine as the base image for building the application
 | |
| FROM golang:1.22-alpine AS builder
 | |
| # Define the base directory for the application as an environment variable
 | |
| ENV SERVER_DIR=/openim-server
 | |
| 
 | |
| # Set the working directory inside the container based on the environment variable
 | |
| WORKDIR $SERVER_DIR
 | |
| 
 | |
| # Set the Go proxy to improve dependency resolution speed
 | |
| 
 | |
| #ENV GOPROXY=https://goproxy.io,direct
 | |
| 
 | |
| # Copy all files from the current directory into the container
 | |
| COPY . .
 | |
| 
 | |
| RUN go mod tidy
 | |
| 
 | |
| 
 | |
| 
 | |
| RUN go build -o _output/openim-rpc-third ./cmd/openim-rpc/openim-rpc-third
 | |
| 
 | |
| 
 | |
| # Using Alpine Linux for the final image
 | |
| FROM alpine:latest
 | |
| 
 | |
| # Install necessary packages, such as bash
 | |
| RUN apk add --no-cache bash
 | |
| 
 | |
| # Set the environment and work directory
 | |
| ENV SERVER_DIR=/openim-server
 | |
| WORKDIR $SERVER_DIR
 | |
| 
 | |
| 
 | |
| # Copy the compiled binaries and mage from the builder image to the final image
 | |
| COPY --from=builder $SERVER_DIR/_output $SERVER_DIR/_output
 | |
| # COPY --from=builder $SERVER_DIR/config $SERVER_DIR/config
 | |
| 
 | |
| # Set the command to run when the container starts
 | |
| ENTRYPOINT ["sh", "-c", "_output/openim-rpc-third"]
 |