Page MenuHomeDevCentral

No OneTemporary

diff --git a/Dockerfile b/Dockerfile
index 6880c25..fe7e485 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,32 +1,34 @@
#
# Nasqueron - Phabricator image
#
FROM nasqueron/nginx-php-fpm
MAINTAINER Sébastien Santoro aka Dereckson <dereckson+nasqueron-docker@espace-win.org>
#
# Prepare the container
#
RUN apt-get update && apt-get install -y \
mercurial subversion python-pygments openssh-client \
mysql-client \
--no-install-recommends && rm -r /var/lib/apt/lists/* && \
pear config-set preferred_state beta && \
pecl install APCu
RUN cd /opt && \
git clone https://github.com/phacility/libphutil.git && \
git clone https://github.com/phacility/arcanist.git && \
git clone https://github.com/phacility/phabricator.git && \
mkdir -p /var/tmp/phd && \
chown app:app /var/tmp/phd
COPY files /
#
# Docker properties
#
VOLUME ["/opt/phabricator/conf/local", "/var/repo"]
+
+CMD ["/usr/local/sbin/init-container"]
diff --git a/files/usr/local/bin/setup-phabricator b/files/usr/local/bin/setup-phabricator
new file mode 100755
index 0000000..b2a19f2
--- /dev/null
+++ b/files/usr/local/bin/setup-phabricator
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+
+pushd /opt/phabricator
+
+# MYSQL
+bin/config set mysql.host mysql
+bin/config set mysql.pass $MYSQL_ENV_MYSQL_ROOT_PASSWORD
+if [ -n "$PHABRICATOR_STORAGE_NAMESPACE" ]; then
+ bin/config set storage.default-namespace $PHABRICATOR_STORAGE_NAMESPACE
+fi
+
+# URLs
+bin/config set phabricator.base-uri $PHABRICATOR_URL
+if [ -n "$PHABRICATOR_ALT_FILE_DOMAIN" ]; then
+ bin/config set security.alternate-file-domain "$PHABRICATOR_ALT_FILE_DOMAIN"
+fi
+
+# Mail
+if [ -n "$PHABRICATOR_USE_MAILGUN" ] && [ -n "$PHABRICATOR_DOMAIN" ] ; then
+ bin/config set mailgun.domain $PHABRICATOR_DOMAIN
+fi
+
+# Rights
+chown -R app /var/repo
+
+# We're done
+popd
+touch .initialized
diff --git a/files/usr/local/sbin/init-container b/files/usr/local/sbin/init-container
new file mode 100755
index 0000000..0f5105e
--- /dev/null
+++ b/files/usr/local/sbin/init-container
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+if [ ! -f .initialized ]; then
+ # Container is initialized according the environment variables
+ # passed to the container to setup Phabricator.
+ /usr/local/bin/setup-phabricator
+fi
+
+/usr/local/sbin/runsvdir-init

File Metadata

Mime Type
text/x-diff
Expires
Sun, Oct 12, 05:24 (1 d, 8 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3065192
Default Alt Text
(2 KB)

Event Timeline