Files
open-im-server/deploy.Dockerfile
T

40 lines
1.2 KiB
Docker
Raw Normal View History

2021-09-11 20:58:09 +08:00
FROM golang as build
2021-05-26 19:42:58 +08:00
# 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
2021-09-11 20:58:09 +08:00
WORKDIR /Open-IM-Server
2021-05-26 19:42:58 +08:00
# add all files to the container
COPY . .
2021-09-11 20:58:09 +08:00
WORKDIR /Open-IM-Server/script
2021-05-26 19:42:58 +08:00
RUN chmod +x *.sh
2022-08-19 21:51:35 +08:00
RUN /bin/sh -c ./build_all_service.sh
2021-08-05 11:17:13 +08:00
#Blank image Multi-Stage Build
FROM ubuntu
RUN rm -rf /var/lib/apt/lists/*
2021-09-11 20:58:09 +08:00
RUN apt-get update && apt-get install apt-transport-https && apt-get install procps\
2021-08-05 11:17:13 +08:00
&&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,script file.
2021-10-11 15:21:57 +08:00
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"]
2021-05-26 19:42:58 +08:00
2021-08-05 11:17:13 +08:00
#Copy scripts files and binary files to the blank image
2021-09-11 20:58:09 +08:00
COPY --from=build /Open-IM-Server/script /Open-IM-Server/script
COPY --from=build /Open-IM-Server/bin /Open-IM-Server/bin
2021-05-26 19:42:58 +08:00
2021-09-11 20:58:09 +08:00
WORKDIR /Open-IM-Server/script
2021-05-26 19:42:58 +08:00
2021-10-11 15:21:57 +08:00
CMD ["./docker_start_all.sh"]