Sign inSign up

doantaa/phorge

By doantaa

Updated 5 months ago

Image
0

417

doantaa/phorge repository overview

doantaa/phorge

Unofficial Docker image for Phorge — an open source, community-maintained fork of Phabricator. This image bundles PHP-FPM, Nginx, Phorge, and Arcanist into a single container, ready to run alongside a MySQL container.


What's Inside

  • PHP 8.2-FPM
  • Nginx
  • All required PHP extensions (mysqli, pdo_mysql, mbstring, gd, opcache, etc.)
  • Phorge (pre-installed)
  • Arcanist (pre-installed)
  • Phorge PHD daemon (auto-started on container boot)
  • Auto storage upgrade on every start

Quick Start

1. Create project folder
mkdir phorge && cd phorge
mkdir -p mysql-init
2. Create .env file
# App
APP_PORT=8080
BASE_URI=http://your-domain-or-ip:8080

# MySQL
MYSQL_PORT=3306
MYSQL_USER=root
MYSQL_PASSWORD=your_secure_password
MYSQL_DATABASE=phorge

BASE_URI must contain a dot (e.g. http://127.0.0.1:8080 or https://phorge.example.com). Bare hostnames like http://localhost are not supported.

3. Create mysql-init/init.sql
CREATE DATABASE IF NOT EXISTS phorge CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'your_secure_password';
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;
FLUSH PRIVILEGES;

Replace your_secure_password with the same value as MYSQL_PASSWORD in your .env file.

4. Create docker-compose.yml
services:
  phorge:
    image: doantaa/phorge:latest
    container_name: phorge-app
    ports:
      - "${APP_PORT:-8080}:80"
    volumes:
      - phorge-config:/opt/phorge/conf/local
      - phorge-files:/opt/phorge/files
    environment:
      - MYSQL_HOST=phorge-db
      - MYSQL_PORT=${MYSQL_PORT:-3306}
      - MYSQL_USER=${MYSQL_USER:-root}
      - MYSQL_PASSWORD=${MYSQL_PASSWORD}
      - BASE_URI=${BASE_URI:-http://127.0.0.1:8080}
    depends_on:
      - mysql
    restart: unless-stopped

  mysql:
    image: mysql:8.0
    container_name: phorge-db
    environment:
      - MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
      - MYSQL_DATABASE=${MYSQL_DATABASE:-phorge}
      - MYSQL_ROOT_HOST=%
    volumes:
      - mysql_data:/var/lib/mysql
      - ./mysql-init:/docker-entrypoint-initdb.d
    ports:
      - "${MYSQL_PORT:-3306}:3306"
    restart: unless-stopped

volumes:
  mysql_data:
  phorge-config:
  phorge-files:
5. Run
docker compose up -d
docker compose logs -f phorge-app

Once you see Starting Nginx... in the logs, open your browser at the value of your BASE_URI.


Environment Variables

VariableDefaultDescription
APP_PORT8080Port to access Phorge on host
BASE_URIhttp://127.0.0.1:8080Base URI for Phorge (must contain a dot)
MYSQL_HOSTphorge-dbMySQL container hostname
MYSQL_PORT3306MySQL port
MYSQL_USERrootMySQL username
MYSQL_PASSWORD(required)MySQL password
MYSQL_DATABASEphorgeMySQL database name

First Time Setup

After the container starts, open Phorge in your browser. You will be prompted to create an admin account. Follow the on-screen instructions to complete the setup.


Updating Phorge

Storage upgrade runs automatically every time the container starts. To pull the latest image:

docker compose pull
docker compose up -d
docker image prune -f

Mailer Configuration (Email)

To configure email sending, go to Config → search for cluster.mailers in the Phorge web UI, or run inside the container:

docker compose exec phorge-app bash
cd /opt/phorge
./bin/config set cluster.mailers '[
  {
    "key": "gmail-smtp",
    "type": "smtp",
    "options": {
      "host": "smtp.gmail.com",
      "port": 587,
      "user": "[email protected]",
      "password": "your-app-password",
      "protocol": "tls"
    }
  }
]'

For Gmail, use an App Password, not your regular Gmail password. Make sure 2-Step Verification is enabled on your Google account.


Useful Commands

# View logs
docker compose logs -f phorge-app

# Enter container shell
docker compose exec phorge-app bash

# Check daemon status
docker compose exec phorge-app /opt/phorge/bin/phd status

# Restart daemon
docker compose exec phorge-app /opt/phorge/bin/phd restart

# Run storage upgrade manually
docker compose exec phorge-app /opt/phorge/bin/storage upgrade --force

# Test send email
docker compose exec phorge-app /opt/phorge/bin/mail send-test --to [email protected] --subject "Test"

Data Persistence

DataStored InDescription
Phorge configphorge-config volumelocal.json and other config files
Uploaded filesphorge-files volumeFiles uploaded by users
MySQL databasemysql_data volumeAll database data

All data persists across container restarts and upgrades.


Source

Tag summary

Content type

Image

Digest

sha256:ac32d7721

Size

243.1 MB

Last updated

5 months ago

docker pull doantaa/phorge