-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
69 lines (57 loc) · 2.64 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Production Stage
FROM alpine:3.18
LABEL maintainer="info@openim.io" \
org.opencontainers.image.source=https://github.com/openim-sigs/openim-base-image \
org.opencontainers.image.description="OpenIM Sigs Image" \
org.opencontainers.image.licenses="MIT"
ARG GO111MODULE=on
ARG GOPROXY=https://goproxy.cn,direct
# Set environment variables
ENV GO111MODULE=$GO111MODULE \
GOPROXY=$GOPROXY \
SERVER_WORKDIR=/openim/openim-server \
CHAT_WORKDIR=/openim/openim-chat \
OPENKF_WORKDIR=/openim/openkf
# OpenIM Config Should pass the path
ENV OPENIM_SERVER_CONFIG_NAME=$SERVER_WORKDIR/config \
OPENIM_SERVER_CMDDIR=$SERVER_WORKDIR/scripts \
OPENIM_SERVER_LOGDIR=$SERVER_WORKDIR/logs \
OPENIM_SERVER_BINDIR=$SERVER_WORKDIR/_output/bin \
OPENIM_CHAT_CONFIG_NAME=$CHAT_WORKDIR/config/config.yaml \
OPENIM_CHAT_CMDDIR=$CHAT_WORKDIR/scripts \
OPENIM_CHAT_LOGDIR=$CHAT_WORKDIR/logs \
OPENIM_CHAT_BINDIR=$CHAT_WORKDIR/_output/bin \
OPENIM_OPENKF_CONFIG_NAME=$OPENKF_WORKDIR/config/config.yaml \
OPENIM_OPENKF_CMDDIR=$OPENKF_WORKDIR/scripts \
OPENIM_OPENKF_LOGDIR=$OPENKF_WORKDIR/logs \
OPENIM_OPENKF_BINDIR=$OPENKF_WORKDIR/_output/bin
WORKDIR /openim
RUN apk --no-cache add tzdata ca-certificates ncurses bash libdrm && \
apk add --no-cache --virtual build-dependencies && \
rm -rf /var/cache/apk/* &&\
ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && \
echo "openim-sigs" > /etc/hostname && \
for dir in "$SERVER_WORKDIR" "$CHAT_WORKDIR" "$OPENKF_WORKDIR"; do \
for subdir in logs _output/bin scripts config; do \
mkdir -p "$dir/$subdir"; \
done; \
done && \
mkdir -p /openim/tools
COPY ./README.md ./LICENSE ./
COPY get_os.sh get_arch.sh source.sh /openim/tools/
RUN /openim/tools/get_os.sh > ~/os && \
/openim/tools/get_arch.sh > ~/arch && \
echo "export OS=$(cat ~/os)" >> /etc/profile && \
echo "export ARCH=$(cat ~/arch)" >> /etc/profile && \
chmod +x /openim/tools/*.sh && \
cp /openim/tools/get_os.sh /bin/get_os && \
cp /openim/tools/get_arch.sh /bin/get_arch
# # Set directory to map logs, config files, scripts, and SDK
# VOLUME ["/openim", \
# "/openim/openim-server/logs", "/openim/openim-server/config", "/openim/openim-server/scripts", "/openim/openim-server/_output/logs", \
# "/openim/openim-chat/logs", "/openim/openim-chat/config", "/openim/openim-chat/scripts","/openim/openim-chat/_output/logs", \
# "/openim/openkf/logs", "/openim/openkf/config", "/openim/openkf/scripts", "/openim/openkf/_output/bin"]
WORKDIR /openim
RUN ["/bin/bash"]
# ONBUILD RUN OS=$(get_os) && \
# ARCH=$(get_arch)