-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |