Local development
Prerequisites
- Docker and Docker Compose.
- Authorized access to development configuration in Keeper. The root README names the record IICNet - Dev .env template.
- A development database with the application’s schema, views, and suitable test data. Use a sanitized copy where possible.
- Composer and a compatible PHP environment if installing dependencies for the bind-mounted application locally.
Do not copy credentials from legacy source files or publish them in documentation.
Use approved development credentials and keep .env out of version control.
Configure the environment
Run commands from the application repository root:
cp .env.example .env
Populate all variables using the approved development configuration:
| Variable | Purpose and current behavior |
|---|---|
APP_URL | Application URL; legacy URL logic also checks it when determining HTTPS |
APP_PORT | Passed into the container, but does not control Compose’s port mapping |
DB_SERVERNAME | Reachable database hostname |
DB_USERNAME | Database username |
DB_PASSWORD | Database password |
DB_NAME | Application database name |
The active Compose mapping is 8881:80, regardless of APP_PORT.
Without a separate proxy, the local HTTP address is http://localhost:8881/.
If using a development hostname and HTTPS proxy, configure that infrastructure
separately and check generated URLs and redirects.
Database service is currently external to Compose
:::important Current configuration
The MariaDB service, its health check, initialization mounts, and application
depends_on are all commented out in docker-compose.yml. Running Compose
as checked in starts only the PHP/Apache application.
:::
Point .env at a database reachable from the container. 127.0.0.1 inside the
application container refers to that container, not the host database.
The legacy MySQLi helper currently connects on port 3306 with
MYSQLI_CLIENT_SSL; verify compatibility with the chosen development database.
Do not assume an optional setting used by the PDO path changes this helper.
If deliberately restoring the commented MariaDB service, review its configuration
first. It references db/setup.sql.gz and db/grant.sql; database-user grants
must agree with .env. Initialization scripts apply to a fresh database data
directory, not as migrations for an existing database. Do not delete database
volumes to troubleshoot without confirming the data can be discarded.
Build and start
docker compose up --build -d
docker compose ps
docker compose logs --tail=100 iic-dev-app
curl -I http://localhost:8881/
The entrypoint starts cron, then Apache in the foreground.
:::warning Email side effects
The image includes an enabled cron entry that calls /delivermail/send.php
every ten minutes. Before starting against any copied database, isolate outbound
email and review queued messages. Do not allow development to deliver to real
members.
:::
Composer dependencies and bind mounts
The image builds vendor/ from public_html/API/forbidden_dir/, but Compose
bind-mounts the entire host public_html/ over /var/www/html. This hides the
image’s dependency directory if the corresponding host directory is absent.
If dependency loading fails, install the locked application dependencies into the host checkout with a compatible PHP/Composer environment:
composer install --working-dir=public_html/API/forbidden_dir
Verify PHP extension requirements rather than assuming a host installation
matches the image. Root forbidden_dir/composer/ is a different, older Composer
project; installing only there does not reproduce the Docker build.
Validate a change
No application-wide automated test runner is defined in the inspected root configuration. Use focused PHP syntax checks and the smoke-test checklist.
docker compose exec iic-dev-app php -l /var/www/html/index.php
Replace the example path with each changed PHP file. Syntax checks do not verify database queries, permissions, browser behavior, or outbound integrations.
For local logs, inspect Compose output and the host logs/ directory, which is
mounted over /var/log/. Stop the local app without deleting database volumes:
docker compose stop iic-dev-app