Files
open-im-server/deploy.Dockerfile
T

35 lines
1.1 KiB
Docker
Raw Normal View History

2023-06-29 22:35:31 +08:00
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
2023-06-09 10:06:15 +08:00
2023-06-29 22:35:31 +08:00
# add all files to the container
COPY . .
2023-06-09 10:06:15 +08:00
RUN chmod +x /Open-IM-Server/script/*.sh && \
/bin/sh -c /Open-IM-Server/script/build_all_service.sh
2023-06-29 22:35:31 +08:00
#Blank image Multi-Stage Build
2023-06-09 10:06:15 +08:00
FROM alpine
RUN apk add --no-cache vim curl tzdata gawk procps net-tools
2023-06-29 22:35:31 +08:00
2023-06-09 10:06:15 +08:00
#Time zone adjusted to East eighth District
RUN ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata
2023-06-29 22:35:31 +08:00
#set directory to map logs,config file,script file.
VOLUME ["/Open-IM-Server/logs","/Open-IM-Server/config","/Open-IM-Server/script","/Open-IM-Server/db/sdk"]
#Copy script files and binary files to the blank image
2023-06-09 10:06:15 +08:00
COPY --from=build --chown=root:root /Open-IM-Server/script /Open-IM-Server/script
COPY --from=build --chown=root:root /Open-IM-Server/bin /Open-IM-Server/bin
2023-06-29 22:35:31 +08:00
WORKDIR /Open-IM-Server/script
2023-06-09 10:06:15 +08:00
CMD ["/Open-IM-Server/script/docker_start_all.sh"]