Dockerfile_xf 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. FROM nginx
  2. MAINTAINER jgiot@163.com
  3. RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  4. VOLUME /tmp
  5. ENV LANG en_US.UTF-8
  6. RUN echo "server { \
  7. listen 80; \
  8. gzip on; \
  9. gzip_static on; \
  10. gzip_types text/plain text/css application/json application/javascript;\
  11. gzip_min_length 1024;\
  12. gzip_vary on;\
  13. client_max_body_size 100m;\
  14. location /mes-server/ { \
  15. proxy_pass http://139.155.176.112:8078/; \
  16. proxy_redirect off; \
  17. proxy_set_header Host mes-server; \
  18. proxy_set_header X-Real-IP \$remote_addr; \
  19. proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
  20. } \
  21. location /jgfile/ { \
  22. proxy_pass http://139.155.176.112:19000/jgfile/; \
  23. proxy_redirect off; \
  24. proxy_set_header Host jgfile; \
  25. proxy_set_header X-Real-IP \$remote_addr; \
  26. proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
  27. } \
  28. #解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 \
  29. location / { \
  30. root /var/www/html/; \
  31. index index.html index.htm; \
  32. if (!-e \$request_filename) { \
  33. rewrite ^(.*)\$ /index.html?s=\$1 last; \
  34. break; \
  35. } \
  36. } \
  37. access_log /var/log/nginx/access.log ; \
  38. } " > /etc/nginx/conf.d/default.conf \
  39. && mkdir -p /var/www \
  40. && mkdir -p /var/www/html
  41. ADD dist/ /var/www/html/
  42. EXPOSE 80
  43. EXPOSE 443