Files
open-im-server/build/docker/openim-api/Dockerfile
T

33 lines
788 B
Docker
Raw Normal View History

2023-08-02 16:59:58 +08:00
# OpenIM base image: https://github.com/openim-sigs/openim-base-image
# Set go mod installation source and proxy
FROM golang:1.20 AS builder
ARG GO111MODULE=on
ARG GOPROXY=https://goproxy.cn,direct
2023-08-03 00:02:24 +08:00
WORKDIR /openim/openim-server
2023-08-02 16:59:58 +08:00
ENV GO111MODULE=$GO111MODULE
ENV GOPROXY=$GOPROXY
2023-08-03 15:00:30 +08:00
COPY go.mod go.sum ./
RUN go mod download
2023-08-02 16:59:58 +08:00
COPY . .
2023-08-03 00:02:24 +08:00
RUN make clean
RUN make build BINS=openim-api
2023-08-02 16:59:58 +08:00
2023-08-03 15:43:53 +08:00
FROM ghcr.io/openim-sigs/openim-bash-image:v1.3.0
2023-08-02 16:59:58 +08:00
2023-08-03 00:02:24 +08:00
WORKDIR /openim/openim-server
2023-08-02 16:59:58 +08:00
2023-08-03 00:02:24 +08:00
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
2023-08-02 16:59:58 +08:00
2023-08-03 00:02:24 +08:00
EXPOSE ${10002}
2023-08-02 16:59:58 +08:00
2023-08-03 15:00:30 +08:00
CMD ["sh","-c","${OPENIM_SERVER_BINDIR}/platforms/${OS}/${ARCH}/openim-api --port 10002 -c ${SERVER_WORKDIR}/config"]