npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-docker-laravel

v1.1.1

Published

Docker compose generator for a full Laravel setup

Downloads

5

Readme

generator-docker-laravel NPM version Build Status Dependency Status Coverage Status

Docker compose generator for a full Laravel setup

Installation

First, install Yeoman and generator-docker-laravel using npm (we assume you have pre-installed node.js).

npm install -g yo
npm install -g generator-docker-laravel

Then generate your new project:

yo docker-laravel

This generator creates a docker-compose file (docker-compose.yml) and scripts (dc-aliases/dc-aliases.bat and update-notifications-service.sh/update-notifications-service.bat) that helps you build and run a full Laravel project inside a set of docker containers. You choose which containers are created. At the moment the following containers are available:

  • NGINX container with FPM PHP 7.1 (mandatory)
  • Database container (for the moment only MySQL is supported) (mandatory)
  • Queue daemon used to run artisan queue command (includes a Redis container)
  • Notifications daemon used to broadcast events using Socket.io (includes a Redis container)
  • Adminer

Quick demo

generator-demo

Longer walkthrough videos

01. Basic walkthrough

02. Using adminer

03. The queue daemon

04. The notifications daemon

05. Managing containers

06. Windows 10 with Command Prompt only

Getting Started

Once generator-docker-laravel is installed go to your Laravel project folder, open a bash or command prompt window

yo docker-laravel
  • Answer the generator prompts, and select which containers you want to setup
  • Based on your options, the following files will be created:
  • docker-compose.yml: the docker compose file where all services are defined
  • dc-aliases: a set of aliases to help manage the docker containers from bash
  • dc-aliases.bat: a set of aliases to help manage the docker containers from a Windows command prompt
  • update-notifications-service.sh: bash script to recreate the NodeJS notifications daemon (when the code is changed the daemon should be updated)
  • update-notifications-service.bat: windows 10 command prompt script to recreate the NodeJS notifications daemon (when the code is changed the daemon should be updated)
  • nodejs-apps folder where the NodeJS notifications daemon sample app is stored
  • Enter: source dc-aliases to import the docker-compose alias into your terminal's session. Optionally you can copy them permanently to your shell's configuration file. On Windows, from the command prompt, just type: dc-aliases.bat

Launching the containers

To launch the service containers just type:

dc-up

To stop and remove all containers type:

dc-down

Daily usage

To run common tasks use the following aliases:

  • dc-art or dc-artisan - to run artisan (e.g. dc-art migrate)
  • dc-phpunit - to run phpunit (e.g. dc-phpunit tests)
  • dc-phpspec - to run phpspec

The following aliases are provided for additional maintenance:

  • dc-adminer - to launch the adminer container
  • dc-clear-generated - to remove all generated images (all service containers must be stopped before running this command)

Important notes:

  • Version 1.7 or greater of docker-compose is required because docker-compose configuration file reads environment variables from the Laravel .env file
  • Composer CLI must be installed to manage Laravel's package dependencies (the generator does not create a composer container)
  • This generator is an improvement of my first approach to dockerize a Laravel project

License

Apache-2.0 © Vitor Carreira