Last active
November 12, 2015 18:23
-
-
Save mikattack/a8e8ae82653bff9dfa0c to your computer and use it in GitHub Desktop.
Docker-ized Webserver Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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