+escaped_installdir=$(printf '%s\n' "$INSTALLDIR" | sed -e 's/[\/&]/\\&/g')
+sudo sed -i 's/PHABDEV_HOST/'${HOST}'/g' /etc/nginx/conf.d/phab.conf
+sudo sed -i 's/PHABDEV_INSTALLDIR/'${escaped_installdir}'/g' /etc/nginx/conf.d/phab.conf
+
# Wait for mysql
while ! nc -z phabdev-db 3306 2>/dev/null
do
sleep 0.1
done
mariadb --host=phabdev-db --user=root --password=phabricator_secret --execute="GRANT ALL PRIVILEGES ON *.* TO 'phabricator'@'%' IDENTIFIED BY 'phabricator' WITH GRANT OPTION;"
$installdir/bin/storage upgrade --force
sudo -u phab-phd $installdir/bin/phd start
sudo php-fpm7.4 --daemonize
-echo "Starting web server on http://localhost:8080 ..."
+echo "(Remember to update /etc/hosts to include \"127.0.0.1 $host\")"
A docker-compose configuration for running a phabricator server for development
## Setup
1. Clone this repository
-2. Symlink `phabricator` and `arcanist` inside the repo folder
+2. Modify the `.env` file to set desired variables
+ - The `INSTALLDIR` variable should generally not be changed, it's the location within the container where phabricator/arcanist will be installed to.
+ - The `HOST` variable is the hostname for phabricator to be hosted on. Phabricator requires something with a `.` so this cannot be `localhost`. Pro-tip: do not use `something.dev` as the `.dev` TLD is a valid domain and browsers will likely force loading using HTTPS instead of HTTP.
+ - The `PORT` variable is the port to be exposed on the host, in case other services are running or you don't want to use the default port 80.
+3. Modify the `conf/local.json` file to configure for your setup
+ - Items above the blank line should generally not need configured. JSON does not support comments otherwise this would be indicated directly in the file.
+ - Update `phabricator.timezone` to match your current/local timezone. The value for this should be a valid PHP time zone.
+3. Symlink `phabricator` and `arcanist` inside the repo folder
```
$ ln -s ../phabricator phabricator
$ ln -s ../arcanist arcanist
```
-3. Start the containers
+4. Start the containers. The first time this runs the container image will be built.
```
$ docker-compose up
```
-4. Modify local `/etc/hosts` and add `127.0.0.1 phabricator.dev`
-5. Navigate to `http://phabricator.dev:8080`
+5. Modify local `/etc/hosts` and add `127.0.0.1 phabricator.test`
+6. Navigate to `http://phabricator.test`
+7. Address outstanding setup issues such as configuring an Auth Provider. These setup issues can be ignored since this is only intended for local development:
+ - Alternate File Domain Not Configured
+ - Mailers Not Configured
+If you need to modify the `.env` file after the first time running `docker-compose up` you will need to re-build using `docker-compose build --no-cache`.