This is a Phalcon application server image based on Apache (with SSL support) and PHP5. In order to use this image effectively, you'll need to mount:
- /var/www/phalcon/ for your app code (e.g. using "-v /home/jdoe/myapp/:/var/www/phalcon/"), with your document root in a directory named public/
- /var/log/apache2, optionally, if you want to store logfiles visibly outside the container
- /etc/ssl, optionally, if you wish to use SSL with real keys
A note on SSL
As per the defaults, Apache will use the bundled "snakeoil" key when serving SSL. Obviously this isn't sufficient or advisable for production, so you'll want to mount your real keys onto /etc/ssl/. If you name them "certs/ssl-cert-snakeoil.pem" and "private/ssl-cert-snakeoil.key", you'll be able to get by with the default config. Otherwise, you'll want to include a revised site definition. If you don't want to use SSL, you can avoid forwarding port 443 when launching the container (see below).
Assuming you have your app code at /home/jdoe/myapp/, with a public/ directory within it suitable to act as the document root, then the below will be sufficient to serve it. Note that many Docker users encourage mounting data from a storage container, rather than directly from the filesyetem.
- "It works!":
docker run -p 80:80 -p 443:443 -d eboraas/phalconand browse to the host's IP address using http or https
- Serving your own app, with SSL support:
docker run -p 80:80 -p 443:443 -v /home/jdoe/myapp/:/var/www/phalcon/ -d eboraas/phalcon
- ... without SSL support:
docker run -p 80:80 -v /home/jdoe/myapp/:/var/www/phalcon/ -d eboraas/phalcon
- ... using non-standard ports:
docker run -p 8080:80 -p 8443:443 -v /home/jdoe/myapp/:/var/www/phalcon/ -d eboraas/phalcon
Why it says could not find driver
#0 [internal function]: PDO->__construct('mysql:host=mysq...', 'root', 'root', Array)?
I have an 500 error when I run myapp via -v, how could I look in server log?
docker run -p 80:80 -v /mydir/phalcon/:/var/www/phalcon/ -d eboraas/phalcon
@drewmcmurry Can you give me the exact command line that you're using? I am not seeing that problem here.
Can't seem to mount a volume..
"Container command '/usr/sbin/apache2ctl' not found or does not exist.."
I have the default site issues fixed now, as well as some other build issues. Can you try again now?
Using a basic Micro Phalcon application getting this:
[pid 9] AH00052: child pid 75 exit signal Illegal instruction (4)
The code is really just creating an app and calling $app->handle(). looks like an issue with this image.
you are not enabling the phalcon site during the build process. Using your tutorial above all you get is the Debian default html page