Skip to content

Commit 4ed1d8d

Browse files
committed
Fixed bug and updated README. (fixes dockerfile#1)
1 parent cf73631 commit 4ed1d8d

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ RUN apt-get install -y software-properties-common
1212
RUN add-apt-repository -y ppa:nginx/stable
1313
RUN apt-get update
1414
RUN apt-get install -y nginx
15+
RUN echo "\ndaemon 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.
1722
WORKDIR /etc/nginx

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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.

0 commit comments

Comments
 (0)