Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3744390
D39.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D39.id.diff
View Options
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,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
--- /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
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 05:00 (19 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2247034
Default Alt Text
D39.id.diff (1 KB)
Attached To
Mode
D39: Initialize Phabricator at first container run
Attached
Detach File
Event Timeline
Log In to Comment