mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-07-03 08:58:12 +08:00
* 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
25 lines
619 B
Docker
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"] |