Created
July 19, 2017 09:50
-
-
Save a2chub/b969e5bb6e1e048a339380f0d48229e6 to your computer and use it in GitHub Desktop.
simple nginx on docker
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
$ docker build . -t hoge/web | |
$ docker run -p 8080:80 -t hoge/web |
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: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;"] |
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
hello world |
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
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