Skip to content

Commit

Permalink
fix: fix image
Browse files Browse the repository at this point in the history
Signed-off-by: Xinwei Xiong(cubxxw-openim) <[email protected]>
  • Loading branch information
cubxxw committed Aug 7, 2023
1 parent aadf95d commit 17784ce
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 17 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ FROM ghcr.io/openim-sigs/openim-bash-image:latest

WORKDIR ${CHAT_WORKDIR}

COPY --from=builder ${SERVER_WORKDIR}/_output/bin/platforms /openim/openim-chat/_output/bin/platforms
COPY --from=builder ${CHAT_WORKDIR}/_output/bin/platforms /openim/openim-chat/_output/bin/platforms
COPY --from=builder ${OPENIM_CHAT_CMDDIR} /openim/openim-chat/scripts
COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml

Expand Down
11 changes: 7 additions & 4 deletions build/docker/api-admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /openim/openim-chat/bin/admin-api ./cmd/api/admin-api
RUN make clean
RUN make build BINS=api

RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/chat-api

FROM ghcr.io/openim-sigs/openim-bash-image:latest

WORKDIR ${CHAT_WORKDIR}

COPY --from=builder ${OPENIM_CHAT_BINDIR}/admin-api /openim/openim-chat/bin/admin-api
COPY --from=builder ${OPENIM_CHAT_BINDIR}/platforms /openim/openim-chat/_output/bin/platforms
COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml

env PORT=10009
ENV PORT=10009

EXPOSE ${PORT}
CMD ["bash","-c","${OPENIM_CHAT_BINDIR}/admin-api --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"]
CMD ["bash","-c","${OPENIM_CHAT_BINDIR}/platforms/${OS}/${ARCH}/admin-api --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"]
11 changes: 7 additions & 4 deletions build/docker/api-chat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@ RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /openim/openim-chat/bin/chat-api ./cmd/api/chat-api
RUN make clean
RUN make build BINS=api

RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/admin-api

FROM ghcr.io/openim-sigs/openim-bash-image:latest

WORKDIR ${CHAT_WORKDIR}

COPY --from=builder ${OPENIM_CHAT_BINDIR}/chat-api /openim/openim-chat/bin/chat-api
COPY --from=builder ${OPENIM_CHAT_BINDIR}/platforms /openim/openim-chat/_output/bin/platforms
COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml

env PORT=10008
ENV PORT=10008

EXPOSE ${PORT}
CMD ["sh", "-c","${OPENIM_CHAT_BINDIR}/chat-api --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"]
CMD ["bash", "-c","${OPENIM_CHAT_BINDIR}/platforms/${OS}/${ARCH}/chat-api --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"]
11 changes: 7 additions & 4 deletions build/docker/rpc-admin/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@ RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /openim/openim-chat/bin/admin-rpc ./cmd/rpc/admin-rpc
RUN make clean
RUN make build BINS=rpc

RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/chat-rpc

FROM ghcr.io/openim-sigs/openim-bash-image:latest

WORKDIR ${CHAT_WORKDIR}

COPY --from=builder ${OPENIM_CHAT_BINDIR}/admin-rpc /openim/openim-chat/bin/admin-rpc
COPY --from=builder ${OPENIM_CHAT_BINDIR}/platforms /openim/openim-chat/_output/bin/platforms
COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml

env PORT=30200
ENV PORT=30200

EXPOSE ${PORT}
CMD ["sh", "-c", "${OPENIM_CHAT_BINDIR}/admin-rpc --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"]
CMD ["bash", "-c", "${OPENIM_CHAT_BINDIR}/platforms/${OS}/${ARCH}/admin-rpc --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"]
11 changes: 7 additions & 4 deletions build/docker/rpc-chat/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,19 @@ RUN go mod download

COPY . .

RUN CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go build -o /openim/openim-chat/bin/chat-rpc ./cmd/rpc/chat
RUN make clean
RUN make build BINS=rpc

RUN rm -rf ./_output/bin/platforms/$(go env GOOS)/$(go env GOARCH)/admin-rpc

FROM ghcr.io/openim-sigs/openim-bash-image:latest

WORKDIR ${CHAT_WORKDIR}

COPY --from=builder ${OPENIM_CHAT_BINDIR}/chat-rpc /openim/openim-chat/bin/chat-rpc
COPY --from=builder ${OPENIM_CHAT_BINDIR}/platforms /openim/openim-chat/_output/bin/platforms
COPY --from=builder ${OPENIM_CHAT_CONFIG_NAME} /openim/openim-chat/config/config.yaml

env PORT=30300
ENV PORT=30300

EXPOSE ${PORT}
CMD ["sh", "-c","${OPENIM_CHAT_BINDIR}/chat-rpc --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"]
CMD ["bash", "-c","${OPENIM_CHAT_BINDIR}/platforms/${OS}/${ARCH}/chat-rpc --port ${PORT} --config_folder_path ${OPENIM_CHAT_CONFIG_NAME}"]

0 comments on commit 17784ce

Please sign in to comment.