forked from star7th/showdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfileChina
22 lines (17 loc) · 860 Bytes
/
DockerfileChina
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM registry.cn-shenzhen.aliyuncs.com/star7th/showdoc:latest
RUN rm -rf /var/www/html/*
RUN rm -rf /showdoc_data/*
COPY ./ /var/www/html/
RUN mkdir -p /showdoc_data/html
RUN cp -R /var/www/html/ /showdoc_data/
RUN rm -rf /app && ln -s /var/www/html /app
RUN echo "<?php echo file_get_contents('index.html'); ?>" > /var/www/html/web/index.php
RUN mv /showdoc_data/html/mock/ /showdoc_data/mock
RUN (cd /showdoc_data/mock/ && npm install --registry=https://registry.npmmirror.com )
# 写环境变量
ENV SHOWDOC_DOCKER_VERSION 2.2
CMD if [ ! -f "/var/www/html/index.php" ]; then \cp -fr /showdoc_data/html/ /var/www/ ;fi \
;chmod 777 -R /var/www/ \
;(sleep 3 && cd /showdoc_data/html/server && php index.php /api/update/dockerUpdateCode && chmod 777 -R /var/www/ ) \
;(sleep 30 && cd /showdoc_data/mock/ && npm run start) \
& supervisord