Skip to content

Commit

Permalink
first docker file Apache2 container
Browse files Browse the repository at this point in the history
  • Loading branch information
justb4 committed Apr 14, 2016
1 parent 25f2cba commit 11c2fe1
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docker/apache2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:14.04

MAINTAINER just@justobjects.nl

# Silence warnings
RUN export DEBIAN_FRONTEND=noninteractive TERM=linux && \
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \
apt-get update && \
apt-get upgrade

RUN apt-get install -y openssh-server apache2 supervisor

RUN mkdir -p /var/lock/apache2 /var/run/apache2 /var/run/sshd /var/log/supervisor

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf

EXPOSE 22 80

CMD ["/usr/bin/supervisord"]
25 changes: 25 additions & 0 deletions docker/apache2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Apache2 Docker

Inspired by https://docs.docker.com/engine/admin/using_supervisord/.

Docker image runs both Apache2 and SSH daemons.

## Building

docker build -t geonovum/apache2 .

## Running

docker run -p 2222:22 -p 8081:80 -t -i geonovum/apache2

This runs the image and exposes ports 2222 and 8081 mappoing these to the standard
ports 22 and 80 within the container.

NB on Mac OSX via docker machine the actual IP adress is not 127.0.0.1 but e.g. 192.168.99.100
since Docker runs within VirtualBox VM.

Mapping volumes can be handly to maintain all config and data outside the container.
Note that full paths are required.

docker run -p 2222:22 -p 8081:80 -v `pwd`/log:/var/log/apache2 -t -i geonovum/apache2

8 changes: 8 additions & 0 deletions docker/apache2/supervisord.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[supervisord]
nodaemon=true

[program:sshd]
command=/usr/sbin/sshd -D

[program:apache2]
command=/bin/bash -c "source /etc/apache2/envvars && exec /usr/sbin/apache2 -DFOREGROUND"

0 comments on commit 11c2fe1

Please sign in to comment.