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

docker-php-development

v1.1.9

Published

Nginx, PHP-FPM, PHPMyAdmin & MariaDB Docker development environment

Downloads

18

Readme

Docker PHP Development

Docker running Nginx, PHP-FPM, MariaDB and PHPMyAdmin.

A simple package that makes it easy to start a new local development environment.

Install

To install the docker-php-development package use npm or yarn.

NPM:

npm install -g docker-php-development

Yarn:

yarn global add docker-php-development

Note: The package has to be installed globally

Basic Usage

After successfully installing docker-php-development you can use the dock command.

Use dock -h or dock --help to see all possible commands.

Output:

-i, --init        Install the dock into your project
-s, --start       Start the dock
-e, --stop        Stop the dock
-q, --stopall     Stop all running docks
-a, --showall     Show all existing docks
-f, --foreground  Start dock on foreground
-d, --dbdump      Dumps the database into a database.sql file in projectroot
-r, --dbrestore   Retores the database dump in projectroot folder
-l, --logs        Show logs
-h, --help        output usage information

Init the dock:

To start a local development environment use dock -i in your project root.

This will add a new folder into your project, ./docker this folder will hold the configuration files for your dock.

The init option will also ask you to name your containers and assign port numbers to them.

Note: Make sure the container names are unique otherwise docker won't be able to start them.

init command example

Start the dock:

To start the dock use dock -s or dock --start this will create the docker containers.

Go to localhost:YourWebserverPort to view the webserver, the index.html or index.php file in your projectroot will be displayed.

Go to localhost:YourPhpMyAdminPort to view the database, login with root/root or with devdb/devdb.

Note: YourWebserverPort/YourPhpMyAdminPort ports are set in the init process, if you forgot what the set ports are or want to change them go to the docker-compose.yml file in the docker folder inside your projectroot.

The database user devdb and database wordpress is created on the first dock --start this username, password & databasename can also be changed in the docker-compose.yml file in the docker folder inside your projectroot.

Stop the dock:

To stop the dock use dock -e or dock --stop this will stop the docker containers.

Output logs to the shell:

To output logs use dock -l or dock --logs this will continuesly output the logs from the containers.

Note: This can also be achieved with the dock --foreground command, this will start the containers and directly output the logs.

Dump DB:

To dump the database use dock -d or dock --dbdump this will dump the database to the root of your project.

Note: This database.sql file won't automatically get restored on a dock --start, when the containers are stopped they still contain all your data so we won't need to restore the database, but if somehow your container gets destroyed it's nice to have the latest database file.

This can also be usefull for cloning your project, to restore the database simply run dock -r or dock --dbrestore.

Additional info

The docker folder in your project root holds all the files to edit the configuration, to change php.ini values simply go to the ./docker/php.ini file and add any overwrite you need.

The ./docker/Dockerfile contains the PHP-FPM config, it'll use the original latest php:7-fpm image and install some additional packages using apt-get, docker-php-ext & pecl.

The ./docker/nginx.conf contains the nginx config, the basic configuration is probably enough for most PHP projects but you can change this anyway you'd like.

The ./docker/docker-compose.yml contains the docker-compose config, on dock --start this file gets read and will be used to start the containers. Edit this file to change your ports, database_username or database_password


In Projects where you need to use the Database use keyword "database" as the hostname, docker will use the name to lookup the ip:port.

hostname example