Skip to content

Instantly share code, notes, and snippets.

@dabiddo
Created April 6, 2024 01:33
Show Gist options
  • Save dabiddo/f9a4ca82dc3b55d4c2ffb28672b7ad53 to your computer and use it in GitHub Desktop.
Save dabiddo/f9a4ca82dc3b55d4c2ffb28672b7ad53 to your computer and use it in GitHub Desktop.
Docker one-liners to generate new projects

Laravel project

sudo docker run --rm -v $(pwd):/app composer create-project --prefer-dist laravel/laravel <mylaravelproject>

NestJs CLI

sudo docker run --rm -v "$(pwd):/app" -w /app -it node:20.11.1-alpine sh -c "apk add --no-cache git && npm install -g pnpm @nestjs/cli && nest new mynestjsproject && chown -R $(id -u):$(id -g) mynestjsproject"

NuxtJS

sudo docker run --rm -v "$(pwd):/app" -w /app -it node:20.11.1-alpine sh -c "apk add --no-cache git && npm install -g pnpm && pnpm dlx nuxt@latest init <project-name> && chown -R $(id -u):$(id -g) <project-name>"

refine.dev

sudo docker run --rm -v "$(pwd):/app" -w /app -it node:20.11.1-alpine sh -c "apk add --no-cache git && npm init refine-app@latest && chown -R $(id -u):$(id -g) "

Remember to change owner of folder

sudo chown -R myuser:user <mylaravelproject>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment