Download the PHP package hackley2/laravel-docker-package without Composer

On this page you can find all versions of the php package hackley2/laravel-docker-package. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-docker-package

Docker Environment for Laravel


This Laravel Package helps get you up and running with a docker development environment in no time. No need to bog your host computer down with installing a LAMP stack directly.

Creating a new Laravel Project:

Installing Laravel required PHP and Composer installed. If you're following Docker best practices, then you'll want to do the following instead of running https://laravel.com/docs/installation directly on your host machine (because you may not have PHP installed on your host computer).

NOTES: The following commands assume you already have docker CE installed https://docs.docker.com/engine/installation and that your host computer is running Linux or macOS. If you're running Windows, you will need to modify the following commands or be using Microsoft's Bash on Windows https://msdn.microsoft.com/en-us/commandline/wsl/install_guide .

  1. Navigate to where you want to install your new Laravel Project
  2. You need PHP and Composer to install Laravel, so spin up the official Composer docker machine to get access to a bash prompt that has PHP and composer. (Unless otherwise indicated, all commands step #3 through step #8 should be ran from within the docker container's terminal that we get as a result of this command here in step #2)

  3. Install Laravel into a new folder called "blog"

  4. Change directory into the new blog folder

Set up Docker with an existing Laravel Project:

Now that you have your Laravel Project set up, and your terminal is still running the composer bash prompt we opened up in step 2 we can set up the Docker files required for our development environment

  1. Install this repo as a composer package

  2. Register the DockerServiceProvider with Laravel by adding the following line to the 'providers' array in your config/app.php file

  3. Publish the docker folder and docker-compose.yml file to your project

  4. Exit the composer container that we've been performing commands in that we started in step #2

Use Docker

Now that the docker files are all in place, follow these steps to spin up and manage your Docker LAMP stack:

  1. Setup your database settings in your .env file
  2. Set the DB_HOST in your .env file to "mysql"
  3. Spin up your Docker LAMP stack:

  4. Peruse the Notes:
    • All below commands should be ran from the root folder of your Laravel project
    • The DB settings you put in your .env file before you build your docker-compose environment for the first time will cause the MySQL DB's name, user, and password to be set to what your .env file indicates.
    • If you delete the MySQL container, your DB's data will be lost. There are plenty of ways around this. See https://hub.docker.com/_/mariadb/ for more details.
    • If you need to connect to your local development server's terminal for something like db migrations, then get the list of the running docker containers by running docker ps to determine the name of your "phpserver" container and then use the ./docker-exec.sh script file (see below for more details).
    • Once the docker server containers have been started, you can access your Laravel app by pointing your browser to 127.0.0.1

Running a command on one of your docker containers

If you need to run a command in one of your docker containers (such as getting access to your docker container's terminal) use the following command:

If you find that command to be too cumbersome, you can instead use the docker-exec.sh script as follows:

Connect to MySQL

To connect to your mysql server, use this command in your terminal, or enter this commands credentials into your favorite database management program. Use the database password set in your .env file.

Customize your Docker server environment

If you need to run redis, memcached, node.js, or some other server environment, add a new service to the docker-compose.yml file in your project's root. If you don't know enough about Docker to do this, then I'd highly recommend the Docker For Developers book by Chris Tankersley. It's not expensive and provides a great introduction to Docker. It's available via eBook and soft cover at https://www.phparch.com/books/docker-for-developers/ .

If you need PHP extensions that aren't available in hackely2/php-apache, create your own docker file that has the extensions you need. You can even build upon hackley2/php-apache and extend it instead of starting from scratch.


All versions of laravel-docker-package with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package hackley2/laravel-docker-package contains the following files

Loading the files please wait ....