File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,11 @@ RUN apt-get install -y software-properties-common
1212RUN add-apt-repository -y ppa:nginx/stable
1313RUN apt-get update
1414RUN apt-get install -y nginx
15+ RUN echo "\n daemon off;" >> /etc/nginx/nginx.conf
16+
17+ # Attach volumes.
18+ VOLUME /etc/nginx/sites-enabled
19+ VOLUME /var/log/nginx
1520
1621# Set working directory.
1722WORKDIR /etc/nginx
Original file line number Diff line number Diff line change @@ -20,4 +20,10 @@ This repository contains **Dockerfile** of [Nginx](http://nginx.org/) for [Docke
2020
2121### Usage
2222
23- docker run -d -p 80:80 -t dockerfile/nginx
23+ docker run -d -p 80:80 dockerfile/nginx
24+
25+ #### Attach persistent/shared directories
26+
27+ docker run -d -p 80:80 -v <sites-enabled-dir>:/etc/nginx/sites-enabled -v <log-dir>:/var/log/nginx dockerfile/nginx
28+
29+ Open ` http://<host> ` to see the welcome page.
You can’t perform that action at this time.
0 commit comments