Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>pull/457/head
parent
9394ac658e
commit
149fa3a4e3
@ -0,0 +1,39 @@
|
|||||||
|
FROM golang as build
|
||||||
|
|
||||||
|
# go mod Installation source, container environment variable addition will override the default variable value
|
||||||
|
ENV GO111MODULE=on
|
||||||
|
ENV GOPROXY=https://goproxy.cn,direct
|
||||||
|
|
||||||
|
# Set up the working directory
|
||||||
|
WORKDIR /Open-IM-Server
|
||||||
|
# add all files to the container
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
WORKDIR /Open-IM-Server/scripts
|
||||||
|
RUN chmod +x *.sh
|
||||||
|
|
||||||
|
RUN /bin/sh -c ./build_all_service.sh
|
||||||
|
|
||||||
|
#Blank image Multi-Stage Build
|
||||||
|
FROM ubuntu
|
||||||
|
|
||||||
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
|
||||||
|
&&apt-get install net-tools
|
||||||
|
#Non-interactive operation
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
RUN apt-get install -y vim curl tzdata gawk
|
||||||
|
#Time zone adjusted to East eighth District
|
||||||
|
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && dpkg-reconfigure -f noninteractive tzdata
|
||||||
|
|
||||||
|
|
||||||
|
#set directory to map logs,config file,scripts file.
|
||||||
|
VOLUME ["/Open-IM-Server/logs/open-im-server","/Open-IM-Server/config","/Open-IM-Server/scripts","/Open-IM-Server/db/sdk"]
|
||||||
|
|
||||||
|
#Copy scriptss files and binary files to the blank image
|
||||||
|
COPY --from=build /Open-IM-Server/scripts /Open-IM-Server/scripts
|
||||||
|
COPY --from=build /Open-IM-Server/bin /Open-IM-Server/bin
|
||||||
|
|
||||||
|
WORKDIR /Open-IM-Server/scripts
|
||||||
|
|
||||||
|
CMD ["./docker_start_all.sh"]
|
@ -1,34 +0,0 @@
|
|||||||
FROM golang as build
|
|
||||||
|
|
||||||
# go mod Installation source, container environment variable addition will override the default variable value
|
|
||||||
ENV GO111MODULE=on
|
|
||||||
ENV GOPROXY=https://goproxy.cn,direct
|
|
||||||
|
|
||||||
# Set up the working directory
|
|
||||||
WORKDIR /Open-IM-Server
|
|
||||||
|
|
||||||
# add all files to the container
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN chmod +x /Open-IM-Server/scripts/*.sh && \
|
|
||||||
/bin/sh -c /Open-IM-Server/scripts/build_all_service.sh
|
|
||||||
|
|
||||||
#Blank image Multi-Stage Build
|
|
||||||
FROM alpine
|
|
||||||
|
|
||||||
RUN apk add --no-cache vim curl tzdata gawk procps net-tools
|
|
||||||
|
|
||||||
#Time zone adjusted to East eighth District
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
|
|
||||||
dpkg-reconfigure -f noninteractive tzdata
|
|
||||||
|
|
||||||
#set directory to map logs,config file,scripts file.
|
|
||||||
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/scripts","/Open-IM-Server/db/sdk"]
|
|
||||||
|
|
||||||
#Copy scripts files and binary files to the blank image
|
|
||||||
COPY --from=build --chown=root:root /Open-IM-Server/scripts /Open-IM-Server/scripts
|
|
||||||
COPY --from=build --chown=root:root /Open-IM-Server/bin /Open-IM-Server/bin
|
|
||||||
|
|
||||||
WORKDIR /Open-IM-Server/scripts
|
|
||||||
|
|
||||||
CMD ["/Open-IM-Server/scripts/docker_start_all.sh"]
|
|
Loading…
Reference in new issue