Guest User

Untitled

a guest
Oct 25th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. services:
  2. nginx:
  3. build: ./nginx/
  4. ports:
  5. - 443:443
  6. volumes:
  7. - ${APPLICATION_ROOT}:/${WEBROOT}
  8. - ./ssl:/etc/nginx/ssl
  9. - ./nginx/config/default.conf:/etc/nginx/conf.d/default.conf
  10. restart: always
  11. depends_on:
  12. - php
  13. environment:
  14. ENVIRONMENT: "${APPLICATION_ENV}"
  15. URL: "${APPLICATION_URL}"
  16. container_name: nginx
  17.  
  18. php:
  19. build: ./php/
  20. ports:
  21. - 8080:80
  22. volumes:
  23. - ${APPLICATION_ROOT}:/${WEBROOT}
  24. restart: always
  25. depends_on:
  26. - mysql
  27. environment:
  28. ENVIRONMENT: "${APPLICATION_ENV}"
  29. URL: "${APPLICATION_URL}"
  30. MYSQL_HOST: "${DB_HOST}"
  31. MYSQL_DATABASE: "${DB_NAME}"
  32. MYSQL_USER: "${DB_USERNAME}"
  33. MYSQL_PASSWORD: "${DB_PASSWORD}"
  34. container_name: php
  35.  
  36. FROM nginx:latest
  37.  
  38. # Update package libraries
  39. RUN apt-get update -y &&
  40. apt-get install -y
  41. nano
  42. curl
  43. wget
  44. unzip
  45. libmcrypt-dev
  46.  
  47. server {
  48. listen 80;
  49. index index.php index.html;
  50. server_name $URL_from_env;
  51. return 301 https://$host$request_uri;
  52. }
  53.  
  54. server{
  55. listen 443 ssl http2;
  56. index index.php index.html;
  57. server_name $URL_from_env;
  58. error_log /var/log/nginx/error.log;
  59. access_log /var/log/nginx/access.log;
  60. root /var/www/html/public;
  61.  
  62. # set max upload
  63. client_max_body_size 500M;
  64.  
  65. ssl on;
  66. ssl_certificate /etc/nginx/ssl/cert.pem;
  67. ssl_certificate_key /etc/nginx/ssl/cert.key;
  68.  
  69. # use fastcgi for all php files
  70. location ~ .php$ {
  71. try_files $uri =404;
  72. fastcgi_split_path_info ^(.+.php)(/.+)$;
  73. fastcgi_pass php:9000;
  74. fastcgi_index index.php;
  75.  
  76. # include fastcgi parameters
  77. include fastcgi_params;
  78. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  79. fastcgi_param PATH_INFO $fastcgi_path_info;
  80. }
  81.  
  82. # rewrite url's & parse through index
  83. location / {
  84. try_files $uri $uri/ /hub/index.php?$args;
  85.  
  86. # set max upload
  87. client_max_body_size 500M;
  88. }
  89. }
Add Comment
Please, Sign In to add comment