diff --git a/.travis.yml b/.travis.yml index ef4ec3b..39256dc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,7 @@ env: - DOCKERFILE_DIR=stacks/dlrs/oss - DOCKERFILE_DIR=stacks/dlrs/mkl - DOCKERFILE_DIR=postgres + - DOCKERFILE_DIR=nginx script: - cd $DOCKERFILE_DIR diff --git a/nginx/Dockerfile b/nginx/Dockerfile new file mode 100644 index 0000000..f1c73e9 --- /dev/null +++ b/nginx/Dockerfile @@ -0,0 +1,20 @@ +FROM clearlinux:latest +MAINTAINER bin.yang@intel.com + +RUN swupd update $swupd_args && \ + swupd bundle-add nginx $swupd_args +RUN rm -rf /var/lib/swupd + +# forward request and error logs to docker log collector +RUN mkdir -p /var/log/nginx +RUN ln -sf /dev/stdout /var/log/nginx/access.log \ + && ln -sf /dev/stderr /var/log/nginx/error.log + +RUN mkdir -p /var/lib/nginx/ +RUN mkdir -p /etc/nginx/conf.d +RUN cp -f /usr/share/nginx/conf/nginx.conf.example /etc/nginx/nginx.conf +COPY default.conf /etc/nginx/conf.d/default.conf + +VOLUME /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx/README.md b/nginx/README.md new file mode 100644 index 0000000..090e7c5 --- /dev/null +++ b/nginx/README.md @@ -0,0 +1,31 @@ +nginx +========== +This provides a Clear Linux* nginx service + +Build +----- +``` +docker build -t clearlinux/nginx . +``` + +Or just pull it from Dockerhub +--------------------------- +``` +docker pull clearlinux/nginx +``` + +Start nginx Container +----------------------- +``` +docker run -p 80:80 -v /var/www:/var/www -d clearlinux/nginx +``` + +How to use this image +--------------------- +- See ``How to use this image`` section of the official nginx image [page](https://hub.docker.com/_/nginx). + +Extra Build ARGs +---------------- +- ``swupd_args`` Specifies [SWUPD](https://clearlinux.org/documentation/swupdate_how_to_run_the_updater.html) flags + +Default build args in Docker are on: https://docs.docker.com/engine/reference/builder/#arg diff --git a/nginx/default.conf b/nginx/default.conf new file mode 100644 index 0000000..aa4585a --- /dev/null +++ b/nginx/default.conf @@ -0,0 +1,7 @@ +server { + server_name localhost; + location / { + root /usr/share/nginx/html; + autoindex on; + } +}