adds a command called dserve-php that runs an apache with php

This commit is contained in:
nicosommi 2017-02-02 12:26:19 -03:00
parent f502deb663
commit d26bde9941
2 changed files with 17 additions and 0 deletions

View File

@ -12,6 +12,16 @@ docker dstop dserve-myStaticFolder
docker rm dserve-myStaticFolder
```
## Dserve-php
```bash
cd /myStaticFolder
dserve-php # It will lift an apache and output the port used on the host
# After you used it you can stop and remove it easily by name
# all the created container names will start with the dserve-php prefix
docker dstop dserve-php-myStaticFolder
docker rm dserve-php-myStaticFolder
```
### Doc
This run command has many scenarios, this is just a basic configuration.
```bash

View File

@ -5,6 +5,13 @@ dserve() {
&& docker port $container
}
dserve-php() {
local container=dserve-php-${$(pwd)//\//-}
(docker restart $container \
|| docker run -d --name $container -P -v "$(pwd):/var/www/html:ro" php:5-apache) \
&& docker port $container
}
doc() {
# TODO: add zsh conf
# bind shell so we can change current dir (cd, etc)