Phabricator Docker

Hi,

Can anyone help me getting Phabricator up and running via docker-compose?
I tried it with the bitnami docker image but I simply can’t check out code via ssh and that’s crucial for me.

I was thinking about using the phabricator/phabricator image, but I can’t find any documentation for it.

1 Like

I’m not sure what this is, but we do not publish a Docker image, so this is not official or coming from the upstream.

it’s from this guy:

From what I could tell, upstream was not interested in making a docker image, so I made one for them. :slight_smile:

1 Like

What kind of documentation are you looking for?

thanks for the response :smiley:

Are there configurable variables like mysql server name, sql-username, sql-password?
Do you have a docker-compose file lying around somewhere?

No it doesn’t because, afaik, Phabricator doesn’t support configuration through environment variables.

Here’s a sample docker-compose.yml

version: '3'
services:
  phabricator:
    image: phabricator/phabricator:stable
    restart: always
    ports:
      - "80:80"
    links:
      - db
    volumes:
       - config:/var/www/phabricator/conf
       - files:/var/www/files
  daemon:
    image: phabricator/daemon:stable
    restart: always
    links:
      - db
    volumes:
       - config:/var/www/phabricator/conf
       - files:/var/www/files
  db:
    image: mariadb
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: 'MYROOTPASSWORD'
    volumes:
      - database:/var/lib/mysql
volumes:
  config:
  files:
  database:

I hope this helps, let me know if you have any questions.

Thanks alot for this. I will try it tomorrow.
And thanks for creating the container

1 Like

I was trying to use the bitnami image and never really got it working. I didn’t realize there is this other image. I will try it out later tonight.

One question, I ran into a lot of problems related to the requirement for a registered domain name… I am just wanting to run this privately on a sever inside my LAN with no registered domain name possible. Is there any other work around?

With the bitnami image, I tried to basically create a fictitious domain name by adding an entry to all the /etc/hosts files of the machines involved… And it managed to get past the error page about that, but still it didn’t seem to work…

Perhaps there is something that could be done with a docker image that includes DNS service or something?

What are thoughts about this requirement and working around it for cases where there is no public domain registration available?

So I tried this compose file. It didn’t work. I get a screen complaining that phabricator can’t find mysql and telling me I can use the config utility to configure the Mysql host, port, user and password to try continuing…

Are you sure some of that stuff can’t be added to the compose file somehow?

what is the complete procedure to use this compose file and install phabricator?

The only way to pass configuration into a container, is through environment variables. According to Phabricators documentation the only places it reads configuration from is from the database and config files.

The ./bin directory is in the PATH so you can open up another terminal and run something like:

docker-compose exec phabricator config set <key> <value>

and

docker-compose exec phabricator storage upgrade

to update the database, etc.

If you really want to pass in environment variables into phabricator, you could so with a dynamic configuration file. Something like this maybe:

return [
  'mysql.host' => $_SERVER['MYSQL_HOST'],
  'mysql.user' => $_SERVER['MYSQL_USER'],
  'mysql.pass' => $_SERVER['MYSQL_PASSWORD'],
];

but you will also need to configure Apache to pass the system enivornment variables down to the script

I thought about making something like this dynamic, but Phabricator has a TON of configuration, most of which does not fit neatly into environment variables. At the end of the day, I don’t see a huge advantage in doing all of this versus mounting a volume to store the configuration in json files (which is what Phabricator does by default). I would recommend using the CLI as they recommend.