Dockerfile 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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_vary on;\
  11. client_max_body_size 100m;\
  12. location /client-server/ { \
  13. proxy_pass http://139.155.176.112:7101/; \
  14. proxy_redirect off; \
  15. proxy_set_header Host client-server; \
  16. proxy_set_header X-Real-IP \$remote_addr; \
  17. proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
  18. } \
  19. location /jgfile/ { \
  20. proxy_pass http://139.155.176.112:19000/jgfile/; \
  21. proxy_redirect off; \
  22. proxy_set_header Host jgfile; \
  23. proxy_set_header X-Real-IP \$remote_addr; \
  24. proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for; \
  25. } \
  26. #解决Router(mode: 'history')模式下,刷新路由地址不能找到页面的问题 \
  27. location / { \
  28. root /var/www/html/; \
  29. index index.html index.htm; \
  30. if (!-e \$request_filename) { \
  31. rewrite ^(.*)\$ /index.html?s=\$1 last; \
  32. break; \
  33. } \
  34. } \
  35. access_log /var/log/nginx/access.log ; \
  36. } " > /etc/nginx/conf.d/default.conf \
  37. && mkdir -p /var/www \
  38. && mkdir -p /var/www/html
  39. ADD dist/ /var/www/html/
  40. EXPOSE 80
  41. EXPOSE 443