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

@tmbi/air-local-docker

v1.1.11

Published

Local docker development environment setup and provisioning CLI

Downloads

4

Readme

Air Local Docker

Docker Repository on Quay

Docker based local development environment that works on Mac, Windows, and Linux. Geared to WordPress development but generally any type of site should work. Uses public Docker images hosted on Docker Hub and our own public Docker images hosted on Quay for setting up the development enviroment for your sites.

Extra add ons and automation for 45AIR customers which can be configured by running airlocal auth config, you can check your logged in status with airlocal auth status as well after configuring your authentication to make sure it is still valid.

Prerequisites

Installation

It is generally recommended to scope the install of the airlocal npm package to your user account.

npm install @45air/air-local-docker

You can also globally install the package if needed. NOTE: You may need to use sudo if you get an error trying the global install

npm install -g @45air/air-local-docker

Confirm installation by checking the version installed.

airlocal version

Configuration

The first time you run airlocal you will be prompted to configure it. The configuration file is located at ~/.airlocal/config.json.

By default, AirLocal will store all environments within the ~/air-local-docker-sites directory and try to manage your hosts file when creating and deleting environments.

If you would like to customize the environment path or opt to not have AirLocal update your hosts file, run airlocal configure and follow the prompts.

Updating

To update AirLocal, run npm update @45air/air-local-docker

Command Documentation

Global Commands

Clearing Shared Cache

WP CLI, Composer, and npm all utilize cache to speed up operations and save on bandwidth in the future.

airlocal cache clear Clears the WP CLI, composer, and npm caches.

Updating Docker Images

airlocal image update all Will determine which of the docker images utilized by Air Local Docker are present on your system and update them to the latest version available.

Stopping global services

AirLocal relies on a set of global services to function properly. To turn off global services, run airlocal stop all. This will stop all environments and then the global services.

Environments

Create an Environment

airlocal create will present you with a series of prompts to configure your environment to suit your needs.

It is recommended that you use the .test top level domain (TLD) for your local environments, as this TLD is reserved for the testing of software and is not intended to ever be installed into the global Domain Name System. Additionally, AirLocal is configured to send any container to container traffic for .test TLDs directly to the gateway container, so that things like WP Cron and the REST API can work between environments out of the box.

Delete an Environment

airlocal delete <hostname> will delete an environment with the given hostname. Any local files, docker volumes, and databases related to the environment will be deleted permanently.

A special hostname all is available that will delete all environments. You will be asked to confirm deletion of each environment.

Stop an Environment

airlocal stop <hostname> will stop an environment from running while retaining all files, docker volumes, and databases related to the environment.

A special hostname all is available that will stop all running environments as well as the global services.

Start an Environment

airlocal start <hostname> will start a preexisting environment.

A special hostname all is available that will start all environments as well as the global services.

Restart an Environment

airlocal restart <hostname> will restart all services associated with a preexisting environment.

A special hostname all is available that will restart all environments as well as the global services.

Running WP CLI Commands

Running WP CLI commands against an environment is easy. First, make sure you are somewhere within your environment directory (by default, this is somewhere within ~/air-local-docker-sites/<environment>/). Once within the environment directory, simply run airlocal wp <command>. <command> can be any valid command you would otherwise pass directly to WP CLI.

Examples:

  • airlocal wp search-replace mysite.com mysite.test
  • airlocal wp site list

Shell

You can get a shell inside of any container in your environment using the airlocal shell [<service>] command. If a service is not provided, the phpfpm container will be used by default. Other available services can vary depending on the options selected during creation of the environment, but may include:

  • phpfpm
  • nginx
  • redis

Logs

Real time container logs are available using the airlocal logs [<service>] command. If a service is not provided, logs from all containers in the current environment will be shown. To stop logs, type ctrl+c. Available services can vary depending on the options selected during creation of the environment, but may include:

  • phpfpm
  • nginx
  • redis

Tools

phpMyAdmin

phpMyAdmin is available as part of the global services stack that is deployed to support all of the environments.

Access phpMyAdmin by navigating to http://localhost:8092.

  • Username: root
  • Password: password

MailCatcher

MailCatcher is available as part of the global services stack that is deployed to support all of the environments. It is preconfigured to catch mail sent from any of the environments created by Air Local Docker.

Access MailCatcher by navigating to http://localhost:1080.

Xdebug

Xdebug is included in the php images and is nearly ready to go out of the box. Make sure your IDE is listening for PHP debug connections and set up a path mapping to your local environment's web/wp-content/ directory to /var/www/web/wp-content/ in the container.

Visual Studio Code
  1. Install the PHP Debug extension.
  2. In your project, go to the Debug view, click "Add Configuration..." and choose PHP environment. A new launch configuration will be created for you.
  3. Set the pathMappings parameter to your local web/wp-content/ directory. Example:
"configurations": [
        {
            "name": "Listen for XDebug",
            "type": "php",
            "request": "launch",
            "port": 9000,
            "pathMappings": {
                "/var/www/web/wp-content": "${workspaceFolder}/web/wp-content",
            }
        }
]

Attribution

https://github.com/10up/wp-local-docker-v2