From 154955178cafc8dba107c605cf1a92e2e7457f0c Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Sun, 14 Feb 2021 18:33:45 +0100
Subject: [PATCH 01/11] Clone community modules repo

---
 Dockerfile | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index aacff6e..d3b10e9 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,3 +1,9 @@
-FROM prosody:latest
+FROM prosody:0.11
+MAINTAINER Netz39 Administrators <admin@netz39.de>
 
-# TODO  All the other things …
+ENV DEBIAN_FRONTEND noninteractive
+RUN apt-get install -y --no-install-recommends --no-install-suggests \
+    mercurial
+
+WORKDIR /usr/local/lib
+RUN hg clone https://hg.prosody.im/prosody-modules/ prosody-modules

From 23fcad90bba294a2fa73b4d647ac141c93742cb1 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Sun, 14 Feb 2021 18:44:05 +0100
Subject: [PATCH 02/11] Use working base image

---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index d3b10e9..44cfe7c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,4 @@
-FROM prosody:0.11
+FROM prosody/prosody:0.11
 MAINTAINER Netz39 Administrators <admin@netz39.de>
 
 ENV DEBIAN_FRONTEND noninteractive

From ed134ace9156a26608b741657f23f21ebd84d553 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Sun, 14 Feb 2021 18:44:25 +0100
Subject: [PATCH 03/11] Optimize cloning community modules

---
 Dockerfile | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/Dockerfile b/Dockerfile
index 44cfe7c..4aa2738 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,9 +1,8 @@
 FROM prosody/prosody:0.11
 MAINTAINER Netz39 Administrators <admin@netz39.de>
 
-ENV DEBIAN_FRONTEND noninteractive
-RUN apt-get install -y --no-install-recommends --no-install-suggests \
-    mercurial
+RUN apt-get update \
+    && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
+        mercurial
 
-WORKDIR /usr/local/lib
-RUN hg clone https://hg.prosody.im/prosody-modules/ prosody-modules
+RUN hg clone https://hg.prosody.im/prosody-modules/ /usr/local/lib/prosody-modules

From 456971a63883c2a40622b799a67c8d3cb0d27e05 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Sun, 14 Feb 2021 21:05:08 +0100
Subject: [PATCH 04/11] Install telnet and extend README
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Telnet console is now possible, inspired by … see README.

Link: https://github.com/prosody/prosody-docker
Link: https://github.com/OpusVL/prosody-docker
Link: https://github.com/unclev/prosody-docker-extended
---
 Dockerfile | 3 ++-
 README.md  | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 4aa2738..c62cc3b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -3,6 +3,7 @@ MAINTAINER Netz39 Administrators <admin@netz39.de>
 
 RUN apt-get update \
     && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
-        mercurial
+        mercurial \
+        telnet
 
 RUN hg clone https://hg.prosody.im/prosody-modules/ /usr/local/lib/prosody-modules
diff --git a/README.md b/README.md
index f16055c..50f21ef 100644
--- a/README.md
+++ b/README.md
@@ -3,3 +3,7 @@
 This is for running [prosody](https://prosody.im/) XMPP server software
 as the [Netz39 Jabber-Server](https://jabber.n39.eu/) and maybe you can
 use it, too?!
+
+Based on more or less official [prosody/prosody-docker](https://github.com/prosody/prosody-docker)
+with ideas from [OpusVL/prosody-docker](https://github.com/OpusVL/prosody-docker) and
+[unclev/prosody-docker-extended](https://github.com/unclev/prosody-docker-extended) …

From 880b5504be1692f66f69a6606ac040bb166965d2 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Mon, 15 Feb 2021 20:20:24 +0100
Subject: [PATCH 05/11] Clean apt cache to reduce image size

Suggested-by: Stefan Haun <tux@netz39.de>
---
 Dockerfile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index c62cc3b..ed7d882 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -4,6 +4,7 @@ MAINTAINER Netz39 Administrators <admin@netz39.de>
 RUN apt-get update \
     && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends --no-install-suggests \
         mercurial \
-        telnet
+        telnet \
+    && rm -rf /var/lib/apt/lists/*
 
 RUN hg clone https://hg.prosody.im/prosody-modules/ /usr/local/lib/prosody-modules

From dd7db4ba6ebfaefc97dca1e68616818eb90b9d47 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Tue, 16 Feb 2021 13:16:28 +0100
Subject: [PATCH 06/11] Update prosody-modules to specific recent changeset

Suggested-by: Stefan Haun <tux@netz39.de>
---
 Dockerfile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index ed7d882..80e82ba 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -7,4 +7,5 @@ RUN apt-get update \
         telnet \
     && rm -rf /var/lib/apt/lists/*
 
-RUN hg clone https://hg.prosody.im/prosody-modules/ /usr/local/lib/prosody-modules
+RUN hg clone https://hg.prosody.im/prosody-modules/ /usr/local/lib/prosody-modules \
+    && hg up -C 95262bd1bcb2

From ee3fabd2e20b4168d66490f04c5fc35f02b8e9ac Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Tue, 16 Feb 2021 13:27:42 +0100
Subject: [PATCH 07/11] fixup! Update prosody-modules to specific recent
 changeset

We must call hg in the correct directory of course, otherwise this:

    abort: no repository found in '/' (.hg not found)!
---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index 80e82ba..e1b19f0 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,4 +8,4 @@ RUN apt-get update \
     && rm -rf /var/lib/apt/lists/*
 
 RUN hg clone https://hg.prosody.im/prosody-modules/ /usr/local/lib/prosody-modules \
-    && hg up -C 95262bd1bcb2
+    && hg up --cwd /usr/local/lib/prosody-modules -C 95262bd1bcb2

From 938bca77d6906db2a391460f569cb3dd6cceee2e Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Mon, 22 Feb 2021 22:17:19 +0100
Subject: [PATCH 08/11] readme: Add some hints how to run this container

---
 README.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 file changed, 54 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 50f21ef..6881108 100644
--- a/README.md
+++ b/README.md
@@ -4,6 +4,57 @@ This is for running [prosody](https://prosody.im/) XMPP server software
 as the [Netz39 Jabber-Server](https://jabber.n39.eu/) and maybe you can
 use it, too?!
 
-Based on more or less official [prosody/prosody-docker](https://github.com/prosody/prosody-docker)
-with ideas from [OpusVL/prosody-docker](https://github.com/OpusVL/prosody-docker) and
-[unclev/prosody-docker-extended](https://github.com/unclev/prosody-docker-extended) …
+Based on more or less official
+[prosody/prosody-docker](https://github.com/prosody/prosody-docker) with
+ideas from
+[OpusVL/prosody-docker](https://github.com/OpusVL/prosody-docker) and
+[unclev/prosody-docker-extended](https://github.com/unclev/prosody-docker-extended)
+…
+
+## Usage
+
+### Build
+
+    docker build --tag prosody:0.11 .
+
+(Or whatever tag you like or need for your local deployments.)
+
+### Run
+
+Some things like the configuration file and the database obviously
+reside outside of any image or container.  We used sqlite as database,
+for other databases, you're on your own.  A local directory/file tree
+could look like this:
+
+```
+.
+├── etc
+│   └── prosody
+│       └── prosody.cfg.lua
+└── var
+    ├── lib
+    │   └── prosody
+    │       └── prosody.sqlite
+    └── log
+        └── prosody
+```
+
+You mount those as volumes to different points.  Some ports have to be
+exposed to the host.
+
+You can use a script to call `docker` with the required options like
+this and name it `run.sh` and call it to start the container:
+
+```sh
+#!/bin/sh
+docker run -d --name prosody --rm \
+        -p 5222:5222 -p 5269:5269 \
+        -v /srv/prosody/etc/prosody:/etc/prosody \
+        -v /srv/prosody/var/lib/prosody:/var/lib/prosody \
+        -v /srv/prosody/var/log/prosody:/var/log/prosody \
+        prosody:0.11
+```
+
+## Development
+
+Pull requests welcome.

From 74a03a2aed1c867947a1ded728b842cdffbb4c06 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Tue, 23 Feb 2021 21:53:51 +0100
Subject: [PATCH 09/11] readme: Unify <pre> environments

Suggested-by: Stefan Haun <tux@netz39.de>
---
 README.md | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 6881108..ca052f0 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,9 @@ ideas from
 
 ### Build
 
-    docker build --tag prosody:0.11 .
+```
+docker build --tag prosody:0.11 .
+```
 
 (Or whatever tag you like or need for your local deployments.)
 

From 275f24aeb21d51cfe05bf23b563d0fc267f22384 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Tue, 23 Feb 2021 21:57:10 +0100
Subject: [PATCH 10/11] prosody-modules: Use recent tip

Numerous improvements, especially for mod_smacks.
---
 Dockerfile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Dockerfile b/Dockerfile
index e1b19f0..938b098 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,4 +8,4 @@ RUN apt-get update \
     && rm -rf /var/lib/apt/lists/*
 
 RUN hg clone https://hg.prosody.im/prosody-modules/ /usr/local/lib/prosody-modules \
-    && hg up --cwd /usr/local/lib/prosody-modules -C 95262bd1bcb2
+    && hg up --cwd /usr/local/lib/prosody-modules -C 38bd4d557413

From b22d28bdee5eda7a9f34a7fd24ff415ad65c9e83 Mon Sep 17 00:00:00 2001
From: Alexander Dahl <alex@netz39.de>
Date: Tue, 23 Feb 2021 22:07:20 +0100
Subject: [PATCH 11/11] readme: Update build instructions

The container should have an up to date base.
---
 README.md | 1 +
 1 file changed, 1 insertion(+)

diff --git a/README.md b/README.md
index ca052f0..8e714eb 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,7 @@ ideas from
 ### Build
 
 ```
+docker pull prosody/prosody:0.11
 docker build --tag prosody:0.11 .
 ```