diff --git a/README.md b/README.md index 93fbac4b065f3467e11bd75ba4d253fc5a70f25e..0aef89c0f8f76db5b443776250bbf96af28c6aa5 100644 --- a/README.md +++ b/README.md @@ -10,26 +10,35 @@ cd lampserver docker build . -t lampserver ``` +# Starting your web project +You need to create a folder where your web files and the database will reside. +``` +# create a project directory +mkdir my-web-project +cd my-web-project +# create a subdirectory for web files +mkdir www +``` +Inside `my-web-project/www` you place your web files. + # Running the server -Go to the directory **where your web files are placed**, and run: +Go to your web project directory (e.g., `my-web-project`) and run: ``` -docker run -it -e PHP_DISPLAY_ERRORS=On -e DOCKER_USER_ID=`id -u \`whoami\`` \ - -p "80:80" -v ${PWD}:/app -v ${PWD}/mysql:/var/lib/mysql --name lampserver-1 \ - --rm lampserver +docker run -it -e APACHE_ROOT=www -e PHP_DISPLAY_ERRORS=On \ + -e DOCKER_USER_ID=`id -u \`whoami\`` -p "80:80" -v ${PWD}:/app \ + -v ${PWD}/mysql:/var/lib/mysql --name lampserver-1 --rm lampserver ``` -`lampserver-1` is the name of the docker *container*, i.e, a running instance +`lampserver-1` is the name of the docker *container*, i.e., a running instance of the `lampserver` image. The first time you run the server in your directory, a MySQL data folder will -be created inside your web directory under `./mysql` -(you can change this if you want changing - `-v :/var/lib/mysql`). +be created inside your project directory `./mysql` A password for the `admin` user of MySQL is shown the first time. - -Your server is available at: http://localhost (if you want to use another port - of your host machine, change `-p "80:80"` by `-p ":80"`) +Your server is available at: http://localhost +(if you want to use another port of your host machine, change `-p "80:80"` +by `-p ":80"`) # Using MySQL 1. You can use PHPMyAdmin by going to http://localhost/phpmyadmin. You have