This package helps to launch and debug Phalcon LAMP project under different versions
Preconfigured Services:
- MySQL 8
- Apache2 + Phalcon3 + php7.3 + DevTools
- Apache2 + Phalcon4 + php7.4 + DevTools
- Apache2 + Phalcon5 + php8.0
Each service configured with support of following libraries:
- Composer
- NewRelic
- xDebug
- JSON, DOM, Tidy, Yaml
- Caching: APCu, Redis
- Database: PDO with MySQL and SQLite support
- Image Processing: ImageMagick, GD, Exif
- BCMath and GMP
- Curl
- i18n support: mbstring, gettext
- Zip
Create a new git project
git clone https://github.com/nazariy/phalcon-nest.gitAdd to existing project under /docker/ directory
git submodule add https://github.com/nazariy/phalcon-nest.git dockerUpdate your .env file where docker-compose.yml is located
# Docker defaults
COMPOSE_PROJECT_NAME=nest
COMPOSE_PROJECT_WORKING_DIR=/home
# MySQL
MYSQL_ROOT_PASSWORD=root
MYSQL_DATABASE=nest
MYSQL_USER=phalcon
MYSQL_PASSWORD=phalcon
MYSQL_HOSTNAME=172.50.50.8
MYSQL_PORT=3306
# Apache defaults
APACHE_DOCUMENT_ROOT=/home
APACHE_PUBLIC_DOCUMENT_ROOT=/home/publicNote: mysql host is not accessible via
localhostfor that reason we are using IP address from our subnet
This step is optional, but it's always good to have some insights on your application performance and issues
Our PHP agent auto-instruments your code so you can start monitoring applications. You can use our guided installation for an automated install, or follow the instructions in this document to complete a basic PHP agent installation. Either way, you need a New Relic account. (It's free, forever.)
Update your php.ini and set your license key which can be obtained for free
[newrelic]
newrelic.license = "YOUR_SHINY_LICENSE"
newrelic.logfile = "/var/log/newrelic/php_agent.log"
newrelic.appname = "Phalcon Application"
newrelic.daemon.logfile = "/var/log/newrelic/newrelic-daemon.log"
newrelic.daemon.app_connect_timeout = 15s
newrelic.daemon.start_timeout = 5sHere is a minimum configuration for PHPStorm, add this lines to your php.ini file, accessed via port 9003
[xdebug]
xdebug.mode = debug,develop
xdebug.idekey = "PHPSTORM"
xdebug.start_with_request = yes
xdebug.client_host = host.docker.internal
xdebug.cli_color = 1By default, when accessing
https://localhostyou would see a test page withphpinfo()output
docker compose -f docker-compose.yml up -d phalcon3docker compose -f docker-compose.yml up -d phalcon4docker compose -f docker-compose.yml up -d phalcon5Please note that DevTools are not compatible with the latest version of Phalcon5
Time to time things can go wrong depending on your current operating system and other factors.
Here are few issues I came across while playing with containers
example error code:
failed to solve rpc error code = unknown desc = failed to solve with frontend dockerfile.v0solution: Disable
buildkit