Page MenuHomeDevCentral

D39.id80.diff
No OneTemporary

D39.id80.diff

diff --git a/Dockerfile b/Dockerfile
--- a/Dockerfile
+++ b/Dockerfile
@@ -30,3 +30,5 @@
#
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
--- /dev/null
+++ b/files/usr/local/bin/setup-phabricator
@@ -0,0 +1,27 @@
+#!/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
--- /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/plain
Expires
Sat, Nov 16, 06:32 (20 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2247192
Default Alt Text
D39.id80.diff (1 KB)

Event Timeline