Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- FROM nginx
- RUN rm /etc/nginx/nginx.conf
- COPY /nginx.conf /etc/nginx/nginx.conf
- COPY / /usr/share/nginx/html
- # Expose ports
- EXPOSE 80
- #user nobody;
- worker_processes auto;
- #error_log logs/error.log;
- #error_log logs/error.log notice;
- #error_log logs/error.log info;
- #pid logs/nginx.pid;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- log_format main '$remote_addr - $remote_user [$time_local] "$request" '
- '$status $body_bytes_sent "$http_referer" '
- '"$http_user_agent" "$http_x_forwarded_for"'
- '$server_name to: $upstream_addr: $request';
- access_log logs/access.log main;
- sendfile on;
- #tcp_nopush on;
- #keepalive_timeout 0;
- keepalive_timeout 65;
- #gzip on;
- server {
- listen 8080;
- server_name 127.0.0.1;
- #charset koi8-r;
- #access_log logs/host.access.log main;
- location / {
- root /usr/share/nginx/html;
- index index.html index.htm;
- try_files $uri /index.html;
- include mime.types;
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- }
- docker build --no-cache -t nginx-custom .
- docker run -d -p 8080:80 --name webserver nginx-custom
- docker ps -a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement