Skip to content

Instantly share code, notes, and snippets.

@jjsaunier
Last active August 14, 2018 18:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjsaunier/64ffa00a8753b2ddc4a93c34368ccf34 to your computer and use it in GitHub Desktop.
Save jjsaunier/64ffa00a8753b2ddc4a93c34368ccf34 to your computer and use it in GitHub Desktop.
PPM under PHAR
{
"directories": ["src", "vendor"],
"files": ["ppm.json"],
"exclude-composer-files": true,
"chmod": "0755",
"dump-autoload": false,
"finder": [
{
"notName": "/LICENSE|.*\\.md|.*\\.dist|Makefile|composer\\.json|composer\\.lock/",
"exclude": [
"doc",
"test",
"Test",
"test_old",
"tests",
"Tests",
"vendor-bin"
],
"in": "vendor"
}
],
"main": "vendor/php-pm/php-pm/bin/ppm",
"output": "app.phar",
"stub": true
}
FROM php-cgi #custom
COPY api.phar /api.phar
EXPOSE 8888
CMD ["/api.phar", "start", "-c", "ppm.json"]
box compile -c box.json
docker build -t api .
docker run --rm api -p 8888:8888
{
"bridge": "MyApp\\PPM\\ApiWorker",
"host": "0.0.0.0",
"port": 8888,
"workers": 4,
"app-env": "prod",
"debug": false,
"logging": true,
"static-directory": "public",
"bootstrap": "MyApp\\PPM\\ApiWorker",
"max-requests": 500,
"populate-server-var": true,
"socket-path": "\/tmp\/.ppm\/run\/api\/",
"pidfile": "\/tmp\/.ppm\/api-ppm.pid",
"cgi-path": "\/usr\/local\/bin\/php-cgi"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment