mirror of https://gitee.com/anolis/sysom.git
53 lines
1.6 KiB
Plaintext
53 lines
1.6 KiB
Plaintext
|
|
FROM node:16.20.1 as web_builder
|
|
COPY sysom_web /root/sysom_web
|
|
WORKDIR /root/sysom_web
|
|
RUN npm config set registry https://registry.npmmirror.com
|
|
RUN yarn config set registry https://registry.npmmirror.com
|
|
RUN yarn
|
|
RUN yarn build
|
|
|
|
|
|
FROM openanolis/anolisos:8.8 as prod
|
|
|
|
# Add epel
|
|
RUN yum install -y https://mirrors.aliyun.com/epel/epel-release-latest-8.noarch.rpm
|
|
RUN bash -c "sed -i 's|^#baseurl=https://download.example/pub|baseurl=https://mirrors.aliyun.com|' /etc/yum.repos.d/epel*"
|
|
RUN bash -c "sed -i 's|^metalink|#metalink|' /etc/yum.repos.d/epel*"
|
|
|
|
# Add required yum packages
|
|
RUN yum makecache
|
|
RUN yum install -y supervisor cronie net-tools
|
|
RUN systemctl enable crond
|
|
RUN yum install -y python3
|
|
RUN yum install -y nginx
|
|
RUN yum install -y redis
|
|
RUN yum install -y wget
|
|
RUN systemctl enable supervisord
|
|
RUN systemctl enable nginx
|
|
|
|
# Init sysom-diagnosis
|
|
ARG SYSOM_HOME=/usr/local/sysom
|
|
ARG SYSOM_SERVER_HOME=${SYSOM_HOME}/server
|
|
|
|
RUN mkdir /root/sysom
|
|
RUN mkdir -p /usr/local/sysom
|
|
COPY conf /root/sysom/conf
|
|
COPY script /root/sysom/script
|
|
COPY deps /root/sysom/deps
|
|
COPY environment /root/sysom/environment
|
|
COPY sysom_server /root/sysom/sysom_server
|
|
|
|
COPY --from=web_builder /root/sysom_web/dist /usr/local/sysom/web
|
|
|
|
RUN bash -x /root/sysom/script/sysom.sh install deps ALL
|
|
RUN bash -x /root/sysom/script/sysom.sh install env ALL
|
|
RUN bash -x /root/sysom/script/sysom.sh install ms sysom_api,sysom_diagnosis,sysom_channel,sysom_monitor_server,sysom_log,sysom_alarm
|
|
|
|
RUN yum clean all
|
|
|
|
COPY docker/sysom-init.service /usr/lib/systemd/system/sysom-init.service
|
|
RUN systemctl enable sysom-init.service
|
|
|
|
# # 环境准备
|
|
ENTRYPOINT [ "/usr/sbin/init" ] |