HomeDevCentral

Initialize Phabricator at first container run

Description

Initialize Phabricator at first container run

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

Reviewers: Kaliiixx

Projects: Nasqueron Docker deployment squad

Differential Revision: http://devcentral.nasqueron.org/D39

Details

Provenance
derecksonAuthored on
Differential Revision
D39: Initialize Phabricator at first container run
Parents
rDPHABcf3a8d39a6a0: Solve two nginx concurrent vhosts issue
Branches
Unknown
Tags
Unknown