Files
open-im-server/Dockerfile
T

31 lines
823 B
Docker
Raw Normal View History

2023-07-13 15:45:03 +08:00
# Build Stage
FROM golang:1.20 AS builder
2023-07-13 15:45:03 +08:00
# Set go mod installation source and proxy
ARG GO111MODULE=on
ARG GOPROXY=https://goproxy.cn,direct
ENV GO111MODULE=$GO111MODULE
ENV GOPROXY=$GOPROXY
2023-06-30 18:59:56 +08:00
# Set up the working directory
WORKDIR /openim/openim-server
COPY go.mod go.sum ./
RUN go mod download
2023-06-30 18:59:56 +08:00
2023-07-13 15:45:03 +08:00
# Copy all files to the container
ADD . .
2023-06-30 18:59:56 +08:00
2023-08-07 14:21:31 +08:00
RUN make clean
RUN make build
2023-06-30 18:59:56 +08:00
FROM ghcr.io/openim-sigs/openim-bash-image:latest
2023-06-30 18:59:56 +08:00
WORKDIR ${SERVER_WORKDIR}
2023-06-30 18:59:56 +08:00
2023-07-13 15:45:03 +08:00
# 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/platforms /openim/openim-server/_output/bin/platforms
2023-06-30 18:59:56 +08:00
CMD ["bash","-c","${OPENIM_SERVER_CMDDIR}/docker_start_all.sh"]