From 620de77b7aa29650c38741c2713869d9a8833526 Mon Sep 17 00:00:00 2001 From: lipido Date: Fri, 22 Sep 2017 18:30:31 +0200 Subject: [PATCH] Changes web project layout, keeping mysql folder outside --- README.md | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 93fbac4..0aef89c 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 -- 2.18.1