Cleaned up the docker images to shrink it; expanded docker documentation

This commit is contained in:
Brady Wetherington
2015-02-17 16:22:03 -08:00
parent 3ee9e93349
commit 9be159ea15
2 changed files with 34 additions and 7 deletions
+5 -2
View File
@@ -11,8 +11,11 @@ php5-mysql \
patch \
curl \
git \
php5-mcrypt \
expect
php5-mcrypt
#expect
# stopped using expect (!)
RUN php5enmod mcrypt
+29 -5
View File
@@ -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.
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
```