Skip to content

Instantly share code, notes, and snippets.

@LiYiBin
Created April 18, 2018 09:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LiYiBin/82f3d1e54f6d5ae288c8a81268351655 to your computer and use it in GitHub Desktop.
Save LiYiBin/82f3d1e54f6d5ae288c8a81268351655 to your computer and use it in GitHub Desktop.
# Put Makefile in Laravel Project
init:
docker volume create --driver=local composer_cache_data && \
docker volume create --driver=local npm_cache_data
composer:
docker run --rm -ti \
-v composer_cache_data:/tmp \
-v $(PWD):/app -w /app \
--user $(id -u):$(id -g) \
composer:1.6.4 composer ${arg}
php:
docker run --rm -ti \
-v $(PWD):/app -w /app \
--user $(id -u):$(id -g) \
php:7.2.4-cli php ${arg}
npm:
docker run --rm -ti \
-v npm_cache_data:/root/.npm \
-v $(PWD):/app -w /app \
--user $(id -u):$(id -g) \
node:9.11.1 npm ${arg}
node:
docker run --rm -ti \
-v npm_cache_data:/root/.npm \
-v $(PWD):/app -w /app \
--user $(id -u):$(id -g) \
node:9.11.1 node ${arg}
# Usage
# init
# make init
# composer install
# make composer arg=install
# php artisan list
# make php arg='artisan list'
# npm install
# make npm arg=install
# node -v
# make node arg=-v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment