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
12
12
RUN add-apt-repository -y ppa:nginx/stable
13
13
RUN apt-get update
14
14
RUN 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
15
20
16
21
# Set working directory.
17
22
WORKDIR /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
20
20
21
21
### Usage
22
22
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