From 4e6069cf97e3e705060e23c224d4cfeeb4ef0eeb Mon Sep 17 00:00:00 2001 From: Lloyd Watkin Date: Thu, 13 Nov 2014 15:21:28 +0000 Subject: [PATCH] Do easier deployments, add README --- Dockerfile | 15 ++++++--------- README.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ build-docker.sh | 16 ++++++++++++++++ 3 files changed, 71 insertions(+), 9 deletions(-) create mode 100644 README.md create mode 100755 build-docker.sh diff --git a/Dockerfile b/Dockerfile index f4ac930..956ddcf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,17 +12,14 @@ WORKDIR /data RUN apt-get update RUN apt-get upgrade -y -RUN apt-get install -y mercurial python-setuptools python-dev build-essential libidn11-dev libssl-dev wget bsdmainutils -CMD useradd -ms /bin/bash prosody && groupadd prosody && useradd -G prosody prosody -RUN echo deb http://packages.prosody.im/debian $(lsb_release -sc) main | sudo tee -a /etc/apt/sources.list -RUN wget https://prosody.im/files/prosody-debian-packages.key -O- | apt-key add - +COPY ./build-file.deb /data/prosody.deb + +RUN dpkg -i /data/prosody.deb + RUN apt-get update -RUN apt-get install -y lua5.2 luajit luarocks lua-event lua-zlib lua-dbi-mysql lua-dbi-postgresql lua-dbi-sqlite3 lua-socket liblua5.1-expat0 liblua5.1-filesystem0 lua-sec - -RUN hg clone http://hg.prosody.im/trunk prosody -RUN cd prosody && ./configure --ostype=debian && make && make install +RUN apt-get install -y lua-event lua-zlib lua-dbi-mysql lua-dbi-postgresql lua-dbi-sqlite3 EXPOSE 443 80 5222 5269 5347 5280 -CMD prosodyctl start +CMD prosodyctl start \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..0e66a0c --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# Prosody Docker + +This is the Prosody Docker image building repository. Its only really designed to be used on the Prosody build server for pushing to the [Docker registry](https://registry.hub.docker.com/repos/prosody/). + +It works by coping in a recently built `deb` file and running the install on the system. + +Docker images are built off an __Ubuntu 14.04 LTS__ base. + +```bash +docker run -d prosody/prosody --name prosody -p 5222:5222 +``` + +## Ports + +The image exposes the following ports to the docker host: + +* __80__: HTTP port +* __5222__: c2s port +* __5269__: s2s port +* __5347__: XMPP component port +* __5280__: BOSH / websocket port + +Note: These default ports can be changed in your configuration file. Therefore if you change these ports will not be exposed. + +## Volumes + +Volumes can be mounted at the following locations for adding in files: + +* __/etc/prosody__: + * Prosody configuration file(s) + * SSL certificates +* __/var/log/prosody__: + * Log files for prosody - if not mounted these will be stored on the system + * Note: This location can be changed in the configuration, update to match +* __/usr/lib/prosody-modules__ (suggested): + * Location for including additional modules + * Note: This needs to be included in your config file, see http://prosody.im/doc/installing_modules#paths + +## Example + +``` +docker run -d prosody/prosody:0.9 \ + -p 5222:5222 \ + -p 5269:5269 \ + -p localhost:5347:5347 \ + -v /etc/prosody /data/prosody/configuration \ + -v /var/log/prosody /logs/prosody \ + -v /usr/lib/prosody-modules /data/prosody/modules +``` \ No newline at end of file diff --git a/build-docker.sh b/build-docker.sh new file mode 100755 index 0000000..930ddca --- /dev/null +++ b/build-docker.sh @@ -0,0 +1,16 @@ +# /bin/bash + +if [[ -z "$1" ]]; then + echo "Usage: ./build-docker.sh def_file_name version_number" + exit 1 +fi + +if [[ -z "$2" ]]; then + echo "Usage: ./build-docker.sh def_file_name version_number" + exit 1 +fi + +cp $1 ./prosody.deb +docker build -t prosody/prosody:$2 . +docker push prosody/prosody +docker rmi prosody/prosody:$2 \ No newline at end of file