https://github.com/someson/phalcon5-docker
Application based on Phalcon PHP Framework v5
https://github.com/someson/phalcon5-docker
docker docker-compose nginx phalcon phalcon-framework php
Last synced: 5 months ago
JSON representation
Application based on Phalcon PHP Framework v5
- Host: GitHub
- URL: https://github.com/someson/phalcon5-docker
- Owner: someson
- License: mit
- Created: 2020-12-02T01:27:52.000Z (over 5 years ago)
- Default Branch: php82
- Last Pushed: 2024-11-02T15:43:06.000Z (over 1 year ago)
- Last Synced: 2024-11-02T16:27:53.068Z (over 1 year ago)
- Topics: docker, docker-compose, nginx, phalcon, phalcon-framework, php
- Language: PHP
- Homepage:
- Size: 683 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://supportukrainenow.org/)
[](https://stand-with-ukraine.pp.ua)
# Setup
```sh
$ git clone --branch php81 https://github.com/someson/phalcon5-docker.git .
$ docker-compose up -d --build
```
- add to your ```[...]/etc/hosts```
```text
127.0.0.1 phalcon5.test
```
```sh
$ docker-compose exec p5-app composer install
```
# CLI
## Run console commands
```bash
$ php ./scripts/cli.php [handler] [action] [param1] [param2] ... [paramN] -v -r -s
```
or for docker
```bash
$ docker-compose exec [service-name] php ./scripts/cli.php [handler] [action] [param1] [param2] ... [paramN] -v -r -s
```
Example:
```bash
$ docker-compose exec p5-app php ./scripts/cli.php main main -v -r -s
```
- ```-s``` = single instance allowed
- ```-v``` = verbose info
- ```-r``` = recording the process into several resources of your choice (MySQL, Logs, ...)
## CLI Debugging (xdebug 3.x) in PhpStorm under docker
2 aspects to realize:
1. `-dxdebug.mode=debug -dxdebug.client_host=host.docker.internal -dxdebug.client_port=9003 -dxdebug.start_with_request=yes` has to be in called console command
2. `docker-compose.yml` has to have ENV variable in PHP container: `PHP_IDE_CONFIG=serverName=phalcon5.test`, where `phalcon5.test` is your Settings > PHP > Servers > Name value.
where docker host for Windows or Linux:
> host.docker.internal
Result:
```bash
$ docker-compose exec p5-app php -dxdebug.mode=debug -dxdebug.client_host=host.docker.internal -dxdebug.client_port=9003 -dxdebug.start_with_request=yes ./scripts/cli.php main main -v -s -r
```
with started listenings for PHP debug connections, certainly.
# Tests
```bash
$ docker-compose exec p5-app vendor/bin/codecept run
```
# Troubleshooting
## Docker
if `... did not complete successfully: exit code: 100`
```bash
$ docker image prune -f
```
# TODO
* [switch CI to github workflow](https://www.strangebuzz.com/en/blog/setting-a-ci-cd-workflow-for-a-symfony-project-thanks-to-the-github-actions)