Simple docker image optimised supporting Kitematic to run PHP 7.4-latest applications on Apache with an external path (VOLUME), easy to setup. Including latest NVM, NodeJS, PUG, LESS. Used by the company Virally.
based on docker-php7.4-kitematic:
- install docker (and within its menu, Kitematic)
- get going with this readme
- place your PHP files in connected folder on your computer to be used by the container
...
- start the container (e.g. in Kitematic)
- edit your files, use git or alike
- use docker exec to trigger the compile of pug/less within the container
- reload your browser
...
- stop the container
- turn off your computer
The apache htdocs folder is /app/www
- if you link using --volume ...:/app
you should make sure, your linked folder contains a /www
subfolder with your files. (This allows you to have parent folder containing an .htpasswd
or other *.inc.php
files or alike.)
docker run -p 8000:80 -p 8443:443 --volume "`pwd`/..\":/app --name my-container bananaacid/docker-php7.4-kitematic-pug-virally
docker exec -it my-container bash -cl ' \
npm link gulp less gulp-less less-plugin-autoprefix pug gulp-pug gulp-changed gulp-clean-css gulp-rename gulp-print gulp-sourcemaps gulp-compass ; \
gulp \
'
bash -c -l
is alwayas needed, to have the user profile loaded to have the nvm
, node
, npm
, lessc
, pug
commands available (l for login), and then execute the commands given.
Using npm link
will make gulp available (without installing) within the app folder. (gulp
can not be installed globally, it must always be within the app folder, as well as its requirements)
docker exec -it my-container bash -cl ' lessc ...params '