Add apache

This commit is contained in:
Adnan Abdulhussein
2015-06-02 12:13:47 -07:00
commit 5e617f3a2e
4 changed files with 88 additions and 0 deletions

22
bitnami/apache/Dockerfile Normal file
View File

@@ -0,0 +1,22 @@
FROM ubuntu-debootstrap:14.04
MAINTAINER Bitnami
ENV BITNAMI_APP_NAME apache
ENV BITNAMI_APP_VERSION 2.4.12-0
ENV BITNAMI_APP_DIRNAME apache2
ADD https://storage.googleapis.com/bitnami-artifacts/install.sh?GoogleAccessId=432889337695-e1gggo94k5qubupjsb35tajs91bdu0hg@developer.gserviceaccount.com&Expires=1434934078&Signature=QNkAu%2F8E2RlalSQy4n1sxMhsGKF%2FVltr6zu65HU6A9H0HKOgl6u9etqy9w6OwD4DsLMxYuy2uymOK3iDc5RbfkAMncKI1zJpxcwRQ4Mt43Oe8PBXKbQYcZ7mQaYPtpnjYblDs1S2p12Pu5NTDJHK2hJ1MrIUYwBup5n60R6OJRI%3D /tmp/install.sh
ADD post-install.sh /post-install.sh
RUN sh /tmp/install.sh
RUN sh /post-install.sh /usr/local/bitnami/apache2
ENV PATH /usr/local/bitnami/apache2/bin:$PATH
EXPOSE 80 443
VOLUME ["/logs", "/conf", "/app"]
COPY entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["/usr/local/bitnami/apache2/bin/httpd", "-DFOREGROUND", "-f", "/usr/local/bitnami/apache2/conf/httpd.conf"]

35
bitnami/apache/README.md Normal file
View File

@@ -0,0 +1,35 @@
# Bitnami Apache 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 Apache?
The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.
## Usage
You can instantiate a Bitnami Apache container by doing:
```
HOST_APACHE_HTTP_PORT=8080
HOST_APACHE_HTTPS_PORT=8443
HOST_APACHE_CONF_DIR=`pwd`/apache_conf
HOST_APACHE_APP_DIR=`pwd`/app
docker run -it \
-p $HOST_APACHE_HTTP_PORT:80 \
-p $HOST_APACHE_HTTPS_PORT:443 \
-v $HOST_APACHE_CONF_DIR:/conf \
-v $HOST_APACHE_APP_DIR:/app \
bitnami/apache
```
### Ports
The command above allows you to access Apache 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.
### Configuration
Apache configuration should live in $HOST_APACHE_CONF_DIR on the host. You can edit files in that directory to change the behavior of Apache running inside the container.
### Application content
Static content that you wish to be served via Apache should live in $HOST_APACHE_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.

14
bitnami/apache/entrypoint.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/bin/bash
if [ ! "$(ls -A /conf)" ]; then
cp -r /usr/local/bitnami/apache2/conf.defaults/* /usr/local/bitnami/apache2/conf
fi
if [ ! "$(ls -A /app)" ]; then
cp -r /usr/local/bitnami/apache2/htdocs.defaults/* /usr/local/bitnami/apache2/htdocs
fi
# Remove zombie pidfile
rm -f /usr/local/bitnami/apache2/logs/httpd.pid
exec "$@"

View File

@@ -0,0 +1,17 @@
#!/bin/bash
INSTALL_DIR=$1
cd $INSTALL_DIR
# Backup default conf/htdocs
mv conf conf.defaults
mv htdocs htdocs.defaults
# Setup mount point symlinks
ln -s /usr/local/bitnami/apache2/conf /conf
ln -s /usr/local/bitnami/apache2/logs /logs
ln -s /usr/local/bitnami/apache2/htdocs /app
# Log to stdout
ln -sf /dev/stdout logs/access_log
ln -sf /dev/stderr logs/error_log