fix: gorelease quest

Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
This commit is contained in:
Xinwei Xiong(cubxxw-openim) 2023-08-03 00:02:24 +08:00
parent 809c2bd55c
commit c60288d163
No known key found for this signature in database
GPG Key ID: 1BAD6F395338EFDE
2 changed files with 9 additions and 26 deletions

View File

@ -23,6 +23,6 @@ WORKDIR ${SERVER_WORKDIR}
# Copy scripts and binary files to the production image
COPY --from=builder ${OPENIM_SERVER_CMDDIR} /openim/openim-server/scripts
COPY --from=builder ${SERVER_WORKDIR}/config /openim/openim-server/config
COPY --from=builder ${SERVER_WORKDIR}/_output/bin/ /openim/openim-server/_output/bin/
COPY --from=builder ${SERVER_WORKDIR}/_output/bin/platforms /openim/openim-server/_output/bin/platforms
CMD ["sh","-c","${OPENIM_SERVER_CMDDIR}/docker_start_all.sh"]

View File

@ -1,30 +1,13 @@
FROM golang:1.20.0 as build
WORKDIR /openim
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "Asia/Shanghai" > /etc/timezone && \
mkdir -p /var/log/miniblog
COPY miniblog /openim
EXPOSE 10002
CMD ["./bin/openim-api","--port", "10002"]
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
# Set go mod installation source and proxy
ARG GOARCH
ARG GOOS
FROM golang:1.20 AS builder
ARG GO111MODULE=on
ARG GOPROXY=https://goproxy.cn,direct
WORKDIR /openim/openim-chat
WORKDIR /openim/openim-server
ENV GO111MODULE=$GO111MODULE
ENV GOPROXY=$GOPROXY
@ -32,16 +15,16 @@ ENV GOPROXY=$GOPROXY
COPY . .
RUN go mod download
RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /openim/openim-chat/bin/open_im_admin_api ./cmd/api/admin_api
RUN make clean
RUN make build BINS=openim-api
FROM ghcr.io/openim-sigs/openim-bash-image:latest
WORKDIR ${CHAT_WORKDIR}
WORKDIR /openim/openim-server
COPY --from=builder ${OPENIM_CHAT_BINDIR}/open_im_admin_api /openim/openim-chat/bin/open_im_admin_api
COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-server/config/config.yaml
COPY --from=builder /openim/openim-server/_output/bin/platforms /openim/openim-server/_output/bin/platforms
COPY --from=builder /openim/openim-server/config /openim/openim-server/config
env PORT=10002
EXPOSE ${10002}
EXPOSE ${PORT}
CMD ["sh","-c","${OPENIM_CHAT_BINDIR}/open_im_admin_api","--port", "${PORT}","--config_folder_path","${OPENIM_CHAT_CONFIG_NAME}"]
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-api","--port", "10002"]