Skip to content

Instantly share code, notes, and snippets.

@mikattack
Last active November 12, 2015 18:23
Show Gist options
  • Save mikattack/a8e8ae82653bff9dfa0c to your computer and use it in GitHub Desktop.
Save mikattack/a8e8ae82653bff9dfa0c to your computer and use it in GitHub Desktop.
Docker-ized Webserver Example
FROM ubuntu:14.04
RUN apt-get -y update && apt-get -y install nginx
RUN mkdir -p /var/www/website
ADD nginx/global.conf /etc/nginx/conf.d/
ADD nginx/nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
server {
listen 0.0.0.0:80;
server_name _;
root /var/www/website;
index index.html index.htm;
access_log /var/log/nginx/default_access.log;
error_log /var/log/nginx/default_error.log;
}
<!doctype html>
<html>
<head>
<title>Test website</title>
</head>
<body>
<h1>Sample Website</h1>
<p>It's so simple. The files are <em>in</em> the computer.</p>
</body>
</html>
user www-data;
worker_processes 4;
pid /run/nginx.pid;
daemon off;
events { }
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
include /etc/nginx/mime.types;
default_type application/octet-stream;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
include /etc/nginx/conf.d/*.conf;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment