We suppose this is a develop environment for phpers.
Don't use it in product environment.
docker run -d --name=lemp \ -v /path/to/www/:/var/www/ \ -v /path/to/mysql:/var/lib/mysql \ -p port_of_nginx:80 \ stenote/docker-lemp:latest
- user: root
- (No password)
We don't support SSH right now. You can use
docker exec to enter the docker container.
Container is exiting with error code 1. Any idea why?
@kapilrpatel fixed !
@ uberhacker, I rewrite the nginx config file. you can see here :
https://github.com/stenote/docker-lemp/blob/master/files/root/etc/nginx/sites-enabled/default. Also, you can volumn your own nginx config file. It's not a bug
@agoes, I fix that bug, Thanks a lot. you can pull a new docker image now. Thanks
I was unable to start mysql too like @errogaht had
Then I check mysql error log from the container,
$ docker exec -it lemp /bin/bash
$ tail -f /var/log/mysql/error.log
And found this error
[ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
So i just run this command,
$ mysql_install_db –-user=mysql –ldata=/var/lib/mysql
Have tried restart mysql from container, but it still didn't work. So I ran this command from host terminal
$ docker restart lemp
And it works ..
Looks like mysql data directory is empty when bind the mysql data directory from container "-v /path/to/mysql:/var/lib/mysql \". So we have to add it manually
-v /path/to/www/:/var/www/ should be -v /path/to/www/:/usr/share/nginx/html instead since the default nginx config root points there.
phpinfo() says it's PHP 5.4.36