Conduit: Create Docker container for Mercurial Server (
Bug 1346949). r?mars
This docker container provides a public endpoint for mercurial server, as well as a sidecar container to generate the 'testrepo' which can be cloned and pushed to.
MozReview-Commit-ID: KbdwHHDe8nr
new file mode 100644
--- /dev/null
+++ b/staginghgserver/docker-compose.yml
@@ -0,0 +1,37 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+version: '2'
+services:
+ hgserver:
+ build:
+ context: ./docker
+ dockerfile: ./Dockerfile
+ ports:
+ - "8080:8080"
+ volumes:
+ - data-volume:/repos
+ - ./docker/hgweb.conf:/etc/hg/hgweb.conf
+ environment:
+ - HG_RELEASE=4.1
+ - HG_WEB_CONF=/etc/hg/hgweb.conf
+ depends_on:
+ - hgrepoinit
+
+ hgrepoinit:
+ build:
+ context: ./docker
+ dockerfile: ./Dockerfile
+ volumes:
+ - data-volume:/repos
+ environment:
+ - HG_RELEASE=4.1
+ - HG_WEB_CONF=/etc/hg/hgweb.conf
+ entrypoint:
+ - hg
+ - init
+ - /repos/testrepo
+
+volumes:
+ data-volume:
new file mode 100644
--- /dev/null
+++ b/staginghgserver/docker/Dockerfile
@@ -0,0 +1,23 @@
+FROM alpine
+
+ENV HG_RELEASE=4.1 \
+ HG_WEB_CONF=/etc/hg/hgweb.conf
+
+RUN mkdir -p /etc/hg
+
+RUN apk --no-cache add python
+RUN apk --no-cache add --virtual build-dependencies \
+ build-base \
+ python-dev \
+ py-pip \
+ && pip install --no-cache mercurial==$HG_RELEASE \
+ && apk del build-dependencies
+
+COPY entrypoint.sh /entrypoint.sh
+RUN chmod +x /entrypoint.sh
+
+VOLUME ["/repos"]
+
+EXPOSE 8080
+
+ENTRYPOINT ["/entrypoint.sh"]
new file mode 100644
--- /dev/null
+++ b/staginghgserver/docker/entrypoint.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+cd /repos
+exec hg serve --port 8080 --web-conf ${HG_WEB_CONF}
new file mode 100644
--- /dev/null
+++ b/staginghgserver/docker/hgweb.conf
@@ -0,0 +1,6 @@
+[paths]
+testrepo = /repos/testrepo
+
+[web]
+allow_push = *
+push_ssl = false