open-im-server/Dockerfile
dsx137 b67c03b33e
refactor(changelog): modernize generator and workflows (#3752)
* refactor(changelog): modernize generator and workflows

* fix(core): reduce max file descriptor limit

* test(core): use stable Go in build test workflow

* refactor(core): use golang alpine base image

* fix(build): limit docker compose parallelism

* refactor(build): inline compose build logic

* fix(core): reorder Dockerfile ARG declarations
2026-07-02 16:37:28 +08:00

25 lines
619 B
Docker

FROM golang: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"]