System for registering correspondence. Designed for organizations that receive traditional mail and for businesses providing mail handling services to other entities.
| Layer | Technology |
|---|---|
| Backend | PHP 8.3, Symfony 6.4 |
| Database | MariaDB 10.11 |
| Frontend | Webpack Encore, Bootstrap 5, jQuery |
| Web server | Nginx (Alpine) |
| Containerization | Docker, Docker Compose |
- Docker and Docker Compose
1. Copy and configure the environment file:
cp .env .env.localKey variables in .env.local:
APP_ENV=dev # dev or prod
APP_PORT=7678 # application port on the host
PMA_PORT=7679 # phpMyAdmin port on the host
DB_PORT=3767 # MariaDB port on the host
DB_NAME=posthub
DB_USER=posthub
DB_PASSWORD=posthub
DB_ROOT_PASSWORD=root
DATABASE_URL="mysql://posthub:posthub@mariadb:3306/posthub?serverVersion=mariadb-10.11"2. Start the containers:
docker compose --env-file .env.local up -d3. Install PHP dependencies:
docker compose exec php composer install4. Install JS dependencies and build assets:
docker compose exec php yarn install
docker compose exec php yarn encore dev5. Create the database schema:
docker compose exec php php bin/console doctrine:schema:update --force6. Load initial data (optional — deletes existing data):
docker compose exec php php bin/console --env=dev doctrine:fixtures:loadPorts depend on the values in .env.local (defaults shown below):
| Service | URL | Credentials |
|---|---|---|
| Application | http://localhost:7678 | (admin from fixtures) |
| phpMyAdmin | http://localhost:7679 | root / root |
| MariaDB | localhost:3767 | posthub / posthub |
# Open a shell in the PHP container
docker compose exec php bash
# Clear Symfony cache
docker compose exec php php bin/console cache:clear
# Run database migrations
docker compose exec php php bin/console doctrine:migrations:migrate
# Build assets with watch mode
docker compose exec php yarn encore dev --watch
# View logs
docker compose logs -f
# Stop all containers
docker compose --env-file .env.local downdocker compose --env-file .env.local build php
docker compose --env-file .env.local up -d --no-deps php- PHP >= 8.2 with extensions:
ctype,curl,iconv,openssl,sysvsem,pdo_mysql - Composer 2
- Node.js + Yarn
- MariaDB / MySQL
git clone https://github.com/jakreiter/PostHub.git posthub
cd posthub
cp .env .env.local # set DATABASE_URL and other variables
composer install
yarn install
yarn encore dev
php bin/console doctrine:schema:update --force
php bin/console --env=dev doctrine:fixtures:load # optionalXdebug is installed in the PHP container. To enable step debugging, set in .env.local:
XDEBUG_MODE=debugThen restart the PHP container:
docker compose --env-file .env.local up -d --no-deps phpdocker compose down -v
### Configuration
Environment variables are set directly in `docker-compose.yml`. The file `.env.docker` is provided
as a reference of all Docker-safe defaults — you can copy it to `.env.local` if you prefer
file-based configuration:
```bash
cp .env.docker .env.local
Change the build argument in docker-compose.yml:
build:
args:
PHP_VERSION: "8.2"Then rebuild:
docker compose build --no-cache
docker compose up -d