Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/geshan/docker-laravel-alpine

Docker container for running tests for Laravel 5.x
https://github.com/geshan/docker-laravel-alpine

Last synced: about 1 month ago
JSON representation

Docker container for running tests for Laravel 5.x

Awesome Lists containing this project

README

        

## Docker Container for Laravel 5.x with PHP7

This is a docker container for Laravel 5.x with composer installed.
[Alpine Linux](https://hub.docker.com/_/alpine/) base image its very small at `~75 MB`.
This image is made for running tests for laravel not serving it over a web servicer like Nginx. It is primarily being used to run unit tests on [Wercker](http://wercker.com/).
Do have a look at the [PHP7](https://github.com/geshan/docker-laravel-alpine/tree/php7-branch) version of this image.

[![](https://images.microbadger.com/badges/image/geshan/laravel-alpine.svg)](https://microbadger.com/images/geshan/laravel-alpine "Get your own image badge on microbadger.com")

## Pull it from docker registry

To pull the docker image you can do it with:

```
docker pull geshan/laravel-alpine:php7
```

## Usage

After pulling the image from docker registry, go into laravel project that has a composer.json.
Then run the following commands to run php or composer:

```
docker run -v $(pwd):/var/www geshan/laravel-alpine "composer install --prefer-dist"
```
Lets say if you are have PHPUnit in your composer.json, you can run the following commands
to run your tests:

```
docker run -v $(pwd):/var/www geshan/laravel-alpine "./vendor/bin/phpunit --version"
docker run -v $(pwd):/var/www geshan/laravel-alpine:php7 "./vendor/bin/phpunit"
```

## As base image

You can use it as a base image like below:

```
FROM geshan/laravel-alpine

//my docker image contents
```