Page MenuHomeDevCentral

Initialize Phabricator at first container run
ClosedPublic

Authored by dereckson on Nov 8 2015, 23:55.
Referenced Files
F3744198: D39.id89.diff
Fri, Nov 15, 03:54
F3744151: D39.id81.diff
Fri, Nov 15, 03:36
F3744149: D39.id89.diff
Fri, Nov 15, 03:35
F3744138: D39.id81.diff
Fri, Nov 15, 03:31
F3744092: D39.diff
Fri, Nov 15, 03:13
F3744074: D39.diff
Fri, Nov 15, 03:00
Unknown Object (File)
Wed, Nov 13, 09:06
Unknown Object (File)
Tue, Nov 12, 22:31
Subscribers
None

Details

Summary

When we start the container for the first time, a series of tasks
are run to setup the environment. It allows to configure the part
not stored at database level, and the part required to get a working
setup.

We introduce some environment variables to pass to docker run to
specify the configuration:

  • PHABRICATOR_URL: the base URL
  • PHABRICATOR_DOMAIN: the same, without http:// or https://
  • PHABRICATOR_ALT_FILE_DOMAIN: the domain to serve static files (facultative)
  • PHABRICATOR_STORAGE_NAMESPACE: the storage namespace, when not 'phabricator' (facultative)
  • PHABRICATOR_USE_MAILGUN: if set, use mailgun as mail provider and set domain

We also rely on the environment of the container linked as 'mysql':

  • MYSQL_ROOT_PASSWORD: the root password of the MySQL server

These tasks are stored in /usr/local/bin/setup-phabricator. After
successful run, it creates a .initialized file. A service is added
to only call setup-phabricator if this file doesn't exist.

We use a bash script instead of a pure sh one to use pushd and popd.
See http://stackoverflow.com/a/5193087/1930997.

Test Plan
  1. Build a new image
  2. Run a container, passing sensible environment variables with the P123 script
  3. Ensure docker logs output looks good
  4. Ensure .initialized exists and settings are applied

Diff Detail

Repository
rDPHAB Docker image for Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

dereckson retitled this revision from to Initialize Phabricator at first container run.
dereckson updated this object.
dereckson edited the test plan for this revision. (Show Details)
dereckson added a reviewer: Sandlayth.

Some whitespace issues.

files/usr/local/bin/setup-phabricator
2

Add a whitespace line between the shebang and the actual code

9

4 spaces or a tab expected, not two spaces

files/usr/local/sbin/init-container
6

Whitespace issue?

Should be a tab or 4 spaces everywhere, not both.

dereckson marked 2 inline comments as done.

Fixed whitespace issues

dereckson marked an inline comment as done.EditedNov 9 2015, 00:06

Other done too.

Tabs are used for bash/sh scripts.

Sandlayth edited edge metadata.
This revision is now accepted and ready to land.Nov 10 2015, 09:22
This revision was automatically updated to reflect the committed changes.