adds a command called dserve-php that runs an apache with php
This commit is contained in:
parent
f502deb663
commit
d26bde9941
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user