diff --git a/Dockerfile b/Dockerfile index c2012b2450287d3d54be186d230e4efcf98f3f73..589aa2191b965f1038f0bd7d5d2e323c3ff0b172 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,14 @@ -FROM nginx +FROM nginx:latest MAINTAINER Edward Lee -RUN apt-get update && \ - apt install curl -y && \ - apt-get install git -y - ENV HUGO_VERSION=0.68.1 +ENV RUN_USER nginx +ENV RUN_GROUP nginx + +RUN apt-get update && apt-get install -y \ + git curl && \ + rm -rf /var/lib/apt/lists/* RUN mkdir -p /usr/local/src && \ cd /usr/local/src && \ @@ -18,7 +20,5 @@ RUN cd /src/ && /usr/local/bin/hugo -b / && \ cp -rf /src/public/* /usr/share/nginx/html/ && \ chmod -R 755 /usr/share/nginx/html -ENV RUN_USER nginx -ENV RUN_GROUP nginx EXPOSE 80 ENTRYPOINT nginx -g "daemon off;" diff --git a/README.md b/README.md index 25e77c9a1c7ed7431dbcf42e05b2cbe8c8af3205..087c562ac6f15ac20519ff5ff8d40d0e98f535c0 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ you are welcome to join us. ### Installation -1. Build Image +1. Build an image ``` docker build -t docs:v0.0.1 . @@ -23,18 +23,19 @@ note: here ```docs``` is the image name, you can change it as you need. > > `--build-arg` can be specified many times, like `http_proxy`, `https_proxy`, `HTTP_PROXY`, `HTTPS_PROXY` and so on. -2. Running in container +2. Run a container ``` -docker run -p 80:80 -d docs:v0.0.1 > docs.pid +# YOUR_PORT could be 80 or any other free port on host system +docker run -p ${YOUR_PORT}:80 -d docs:v0.0.1 > docs.pid ``` -The website will serving on http://your-server-ip:80 +The website will serving on http://your-server-ip:${YOUR_PORT} The defalut language(en) will serving on http://your-server-ip/ Other language(zh) will serving on http://your-server-ip/zh -3. Stopping the container +3. Stop the container ``` docker rm -f `cat docs.pid` && rm -f docs.pid