Dockerfile 876 B

123456789101112131415161718192021
  1. FROM webdevops/php-nginx:7.4-alpine
  2. COPY ./ /var/www/html/
  3. RUN mkdir -p /showdoc_data/html
  4. RUN cp -R /var/www/html/ /showdoc_data/
  5. RUN rm -rf /app && ln -s /var/www/html /app
  6. RUN echo "<?php echo file_get_contents('index.html'); ?>" > /var/www/html/web/index.php
  7. RUN echo "upload_max_filesize=5000M;" >> /opt/docker/etc/php/php.ini
  8. RUN echo "post_max_size=5000M;" >> /opt/docker/etc/php/php.ini
  9. RUN echo "client_max_body_size 5000m;" > /opt/docker/etc/nginx/vhost.common.d/10-general.conf
  10. RUN apk update
  11. RUN apk add --update nodejs nodejs-npm
  12. RUN mv /showdoc_data/html/mock/ /showdoc_data/mock
  13. RUN (cd /showdoc_data/mock/ && npm install )
  14. # 写环境变量
  15. ENV SHOWDOC_DOCKER_VERSION 2.0
  16. CMD if [ ! -f "/var/www/html/index.php" ]; then \cp -fr /showdoc_data/html/ /var/www/ ;fi;chmod 777 -R /var/www/ ;(sleep 30 && cd /showdoc_data/mock/ && npm run start) & supervisord