Cleanup and documentation

This commit is contained in:
Adnan Abdulhussein
2015-05-29 14:50:46 -07:00
parent 3acaf8b349
commit 37df0dfaf6
2 changed files with 28 additions and 59 deletions
+2 -1
View File
@@ -1,9 +1,10 @@
FROM ubuntu-debootstrap:14.04
MAINTAINER Bitnami
ENV APP_VERSION 1.8.0-0
RUN apt-get update -q && DEBIAN_FRONTEND=noninteractive apt-get install -qy wget && \
wget -q --no-check-certificate https://downloads.bitnami.com/files/download/nginxstandalonestack/bitnami-nginxstandalonestack-${APP_VERSION}-linux-x64-installer.run -O /tmp/installer.run && \
wget -q --no-check-certificate https://downloads.bitnami.com/files/download/containers/nginxstandalonestack/bitnami-nginxstandalonestack-${APP_VERSION}-linux-x64-installer.run -O /tmp/installer.run && \
chmod +x /tmp/installer.run && \
/tmp/installer.run --mode unattended --prefix /opt/bitnami && \
rm /opt/bitnami/ctlscript.sh /opt/bitnami/use_nginxstandalonestack && \
+26 -58
View File
@@ -1,67 +1,35 @@
Bitnami Nginx image
# Bitnami nginx Docker Container
## Introduction to Bitnami containers
Bitnami provides easy-to-use, consistently configured, and always up-to-date container images. [Click here](https://bitnami.com) for more information on our packaging approach.
## What is nginx?
nginx (pronounced "engine-x") is an open source reverse proxy server for HTTP, HTTPS, SMTP, POP3, and IMAP protocols, as well as a load balancer, HTTP cache, and a web server (origin server).
## Usage
### Basic usage
You can run the Nginx process executing:
```
docker run -it bitnami/nginx
```
If you want to run in the background use:
You can instantiate a Bitnami nginx container by doing:
```
docker run -itd bitnami/nginx
HOST_NGINX_HTTP_PORT=8080
HOST_NGINX_HTTPS_PORT=8443
HOST_NGINX_CONF_DIR=`pwd`/nginx_conf
HOST_NGINX_APP_DIR=`pwd`/app
docker run -it \
-p $HOST_NGINX_HTTP_PORT:80 \
-p $HOST_NGINX_HTTPS_PORT:443 \
-v $HOST_NGINX_CONF_DIR:/conf \
-v $HOST_NGINX_APP_DIR:/app \
Bitnami/nginx
```
### Accessing Nginx from the host
### Ports
The command above allows you to access nginx via ports 8080 and 8443 (or whatever alternative ports you pick) on the host. These will map to ports 80 and 443 respectively inside the container.
By default the container exposes the port 80 and 443, ports that can be mapped doing
### Configuration
nginx configuration should live in $HOST_NGINX_CONF_DIR on the host. You can edit files in that directory to change the behavior of nginx running inside the container. To add custom vhost entries, add appropriate configuration files in $HOST_NGINX_CONF_DIR/vhosts.
```
docker run -it -p 8080:80 -p 8081:443 bitnami/nginx
```
Then Nginx should be accessible via [HTTP](http://localhost:8080) or [HTTPS](http://localhost:8081)
### Volumes
By default the container will expose 3 volumes: /logs, /conf and /app.
#### Logs volume
By default the Nginx container will show the logs via stdout (accessible via docker logs), but if you mount the volume in your host, the Nginx access and error logs will be placed there instead.
```
docker run -it -v /my-logs:/logs bitnami/nginx
```
#### Conf volume
If you already have some nginx configuration files that want to use inside the container or just want to modify the default ones from your host machine, just mount the /conf volume.
```
docker run -it -v /my-conf:/conf bitnami/nginx
```
#### App volume
/app is the directory inside the container which Nginx uses as workdir for static files. If you want to add your own app, just mount this volume and modify any vhost configuration using the config volume explained in the previour paragraph.
```
docker run -it -v /my-app:/app bitnami/nginx
```
An example mouting all the volumes and exposing the ports looks like:
```
docker run -it -p 8080:80 -p 8081:443 \
-v /my-conf:/conf \
-v /my-app:/app
-v /my-logs:/logs \
bitnami/nginx
```
### Linking to another containers.
TODO
### Application content
Static content that you wish to be served via nginx should live in $HOST_NGINX_APP_DIR.
### Logs
By default, without a mapping for /logs specified, the container will send the access and error logs to stdout and stderr respectively. You can optionally map a directory on the host to /logs inside the container (with another -v option); this will write the access and error logs to that directory instead.