Skip to content

Instantly share code, notes, and snippets.

@a2chub
Created July 19, 2017 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a2chub/b969e5bb6e1e048a339380f0d48229e6 to your computer and use it in GitHub Desktop.
Save a2chub/b969e5bb6e1e048a339380f0d48229e6 to your computer and use it in GitHub Desktop.
simple nginx on docker
$ docker build . -t hoge/web
$ docker run -p 8080:80 -t hoge/web
FROM ubuntu:17.04
MAINTAINER a2c <a2cgle@gmail.com>
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y nginx
ADD nginx.conf /etc/nginx/
COPY *.html /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
events {
worker_connections 1024;
}
http{
server {
listen 80 default_server;
server_name nginx;
location / {
try_files $uri $uri/ =404;
root /usr/share/nginx/html;
index index.html index.htm;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment