From 9be159ea1566f5ec80c5d583cb4a0f4183d3ddcf Mon Sep 17 00:00:00 2001 From: Brady Wetherington Date: Tue, 17 Feb 2015 16:22:03 -0800 Subject: [PATCH] Cleaned up the docker images to shrink it; expanded docker documentation --- Dockerfile | 7 +++++-- docker/README.md | 34 +++++++++++++++++++++++++++++----- 2 files changed, 34 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3cf09e1ce7..7a82e151d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,8 +11,11 @@ php5-mysql \ patch \ curl \ git \ -php5-mcrypt \ -expect +php5-mcrypt + +#expect + +# stopped using expect (!) RUN php5enmod mcrypt diff --git a/docker/README.md b/docker/README.md index 4e898822c0..2b40a7c59f 100644 --- a/docker/README.md +++ b/docker/README.md @@ -12,14 +12,20 @@ Figure out what you want for your: * MySQL Password for that user ```sh -docker run --name mysql -e MYSQL_ROOT_PASSWORD=SUPERDUPERSECRETPASSWORD -e MYSQL_DATABASE=snipeit -e MYSQL_USER=snipeit -e MYSQL_PASSWORD=tinglewingler -d -p $(boot2docker ip):33060:3306 mysql +docker run --name mysql -e MYSQL_ROOT_PASSWORD=SUPERDUPERSECRETPASSWORD -e MYSQL_DATABASE=snipeit -e MYSQL_USER=snipeit -e MYSQL_PASSWORD=tinglewingler -d -p $(boot2docker ip)::3306 mysql ``` -That should set you up with your database to use. +That should set you up with your database to use. (You can also use an environment file using --env-file; see docker run --help for details) Now you can start your Snipe-IT container - ```sh -docker run -d -p $(boot2docker ip):8000:80 --name="snipeit" --link mysql:mysql snipeit +docker run -d -p $(boot2docker ip)::80 --name="snipeit" --link mysql:mysql snipeit +``` + +You can find out what port Snipe-IT is running on with: + +```sh +docker port snipeit ``` And finally, you can initialize the application and database like this: @@ -55,7 +61,25 @@ This already happens- When you call ```docker run``` - make sure to mount your own snipe-it directory *over* the /var/www/html directory. Something like: ```sh -docker run -v /Path/To/My/snipe-it/checkout:/var/www/html +docker run -d -v /Path/To/My/snipe-it/checkout:/var/www/html -p $(boot2docker ip)::80 --name="snipeit" --link mysql:mysql snipeit ``` -Then your local changes to the code will be reflected. \ No newline at end of file +Then your local changes to the code will be reflected. You will have to re-run ```composer install``` - + +```sh +docker exec -i -t snipeit composer install +``` + +You'll need to copy the docker/database.php file to ```app/config/production/``` , and copy the ```app/config/production/app.example.php to app/config/production/app.php``` + +And also app:install - + +```sh +docker exec -i -t snipeit php artisan app:install +``` + +And you may still need to generate the key with - + +```sh +docker exec -i -t snipeit php artisan key:generate --env=production +```