Public | Automated Build

Last pushed: a year ago
Short Description
MySQL 5.7、PHP 7.0、Nginx
Full Description

docker-lemp


We suppose this is a develop environment for phpers.

Don't use it in product environment.

Usage

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

Detail

MySQL

  • user: root
  • (No password)

SSH

We don't support SSH right now. You can use docker exec to enter the docker container.

Docker Pull Command
Owner
stenote
Source Repository

Comments (15)
ivoecpereira
9 months ago

Container is exiting with error code 1. Any idea why?

Thanks!

yangchangxi
a year ago

Hi Rio.

stenote
a year ago

@kapilrpatel fixed !

kapilrpatel
a year ago

It is failing with error:

The data directory needs to be specified. Details about error:

https://github.com/docker-library/mysql/issues/69

stenote
2 years ago

@ 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

stenote
2 years ago

@agoes, I fix that bug, Thanks a lot. you can pull a new docker image now. Thanks

stenote
2 years ago

@agoes, I noticed that, I will change entrypoint.sh , thanks. you can watch this project: https://github.com/stenote/docker-lemp.

agoes
2 years ago

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 ..

Conslusion :
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

uberhacker
2 years ago

-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.

saada
2 years ago

phpinfo() says it's PHP 5.4.36