/docker-php7.4-kitematic-pug-virally

Simple docker image optimised to run PHP 7.4-latest applications on Apache with an external path (VOLUME), easy to setup. Including latest NodeJS, PUG, LESS, SASS/Compass to compile sources inside the container for an installation free setup. Used by the company Virally.

Primary LanguagePHPApache License 2.0Apache-2.0

docker-php7.4-kitematic-pug-virally

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: screenshot 2020-02-26

Intended workflow

  1. install docker (and within its menu, Kitematic)
  2. get going with this readme
  3. place your PHP files in connected folder on your computer to be used by the container

...

  1. start the container (e.g. in Kitematic)
  2. edit your files, use git or alike
  3. use docker exec to trigger the compile of pug/less within the container
  4. reload your browser

...

  1. stop the container
  2. turn off your computer

simple


apache web folder

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.)

run docker

docker run -p 8000:80 -p 8443:443 --volume "`pwd`/..\":/app  --name my-container bananaacid/docker-php7.4-kitematic-pug-virally

Using gulp

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)

Using less cli (or pug)

docker exec -it my-container bash -cl ' lessc ...params '

Installation & Documentation

see https://github.com/BananaAcid/docker-php7.4-kitematic