Advertisement
Guest User

Untitled

a guest
Aug 24th, 2017
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. FROM nginx
  2. RUN rm /etc/nginx/nginx.conf
  3. COPY /nginx.conf /etc/nginx/nginx.conf
  4. COPY / /usr/share/nginx/html
  5.  
  6. # Expose ports
  7. EXPOSE 80
  8.  
  9. #user nobody;
  10. worker_processes auto;
  11.  
  12. #error_log logs/error.log;
  13. #error_log logs/error.log notice;
  14. #error_log logs/error.log info;
  15.  
  16. #pid logs/nginx.pid;
  17.  
  18.  
  19. events {
  20. worker_connections 1024;
  21. }
  22.  
  23.  
  24. http {
  25. include mime.types;
  26. default_type application/octet-stream;
  27.  
  28. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  29. '$status $body_bytes_sent "$http_referer" '
  30. '"$http_user_agent" "$http_x_forwarded_for"'
  31. '$server_name to: $upstream_addr: $request';
  32.  
  33. access_log logs/access.log main;
  34.  
  35.  
  36.  
  37. sendfile on;
  38. #tcp_nopush on;
  39.  
  40. #keepalive_timeout 0;
  41. keepalive_timeout 65;
  42.  
  43. #gzip on;
  44.  
  45. server {
  46. listen 8080;
  47. server_name 127.0.0.1;
  48.  
  49. #charset koi8-r;
  50.  
  51. #access_log logs/host.access.log main;
  52.  
  53. location / {
  54. root /usr/share/nginx/html;
  55. index index.html index.htm;
  56. try_files $uri /index.html;
  57. include mime.types;
  58. }
  59.  
  60.  
  61. error_page 500 502 503 504 /50x.html;
  62. location = /50x.html {
  63. root html;
  64. }
  65. }
  66.  
  67. }
  68.  
  69. docker build --no-cache -t nginx-custom .
  70.  
  71. docker run -d -p 8080:80 --name webserver nginx-custom
  72.  
  73. docker ps -a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement