mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-06-06 05:38:13 +08:00
* feat(build): add unified server image build flow Consolidate service image definitions into a single server build setup, and update CI workflows to use it. # Conflicts: # .github/workflows/docker-build-and-release-services-images.yml # .github/workflows/go-build-test.yml # Dockerfile # build/images/Dockerfile # build/images/openim-api/Dockerfile # build/images/openim-crontask/Dockerfile # build/images/openim-msggateway/Dockerfile # build/images/openim-msgtransfer/Dockerfile # build/images/openim-push/Dockerfile # build/images/openim-rpc-auth/Dockerfile # build/images/openim-rpc-conversation/Dockerfile # build/images/openim-rpc-friend/Dockerfile # build/images/openim-rpc-group/Dockerfile # build/images/openim-rpc-msg/Dockerfile # build/images/openim-rpc-third/Dockerfile # build/images/openim-rpc-user/Dockerfile # build/images/openim-tools/component/Dockerfile * fix(ci): correct Docker image tag generation
25 lines
624 B
Docker
25 lines
624 B
Docker
FROM golang:1.25-alpine AS builder
|
|
|
|
ARG RELEASE=false
|
|
ARG COMPRESS=false
|
|
WORKDIR /openim-server
|
|
|
|
RUN apk add --no-cache upx
|
|
|
|
RUN go install github.com/magefile/mage@latest
|
|
|
|
COPY . .
|
|
RUN go mod download
|
|
RUN RELEASE=${RELEASE} COMPRESS=${COMPRESS} mage build
|
|
RUN mage -compile ./mage -ldflags "-s -w"
|
|
|
|
FROM alpine:latest
|
|
|
|
WORKDIR /openim-server
|
|
|
|
COPY --from=builder /openim-server/_output ./_output
|
|
COPY --from=builder /openim-server/config ./config
|
|
COPY --from=builder /openim-server/start-config.yml ./start-config.yml
|
|
COPY --from=builder /openim-server/mage ./mage
|
|
|
|
ENTRYPOINT ["sh", "-c", "./mage start && sleep infinity"] |