Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/laravel-fans/laravel-docker

Full Laravel production environment for Docker
https://github.com/laravel-fans/laravel-docker

composer docker laravel

Last synced: 3 days ago
JSON representation

Full Laravel production environment for Docker

Awesome Lists containing this project

README

        

# Laravel Docker

[![codecov](https://codecov.io/gh/laravel-fans/laravel-docker/branch/main/graph/badge.svg)](https://codecov.io/gh/laravel-fans/laravel-docker)
[![Packagist Downloads](https://img.shields.io/packagist/dt/laravel-fans/docker)](https://packagist.org/packages/laravel-fans/docker)
[![Docker Pulls](https://img.shields.io/docker/pulls/laravelfans/laravel)](https://hub.docker.com/r/laravelfans/laravel)
[![Laravel 10](https://github.com/laravel-fans/laravel-docker/workflows/Laravel%2010/badge.svg)](https://github.com/laravel-fans/laravel-docker/actions/workflows/laravel-10.yml)
[![Laravel 11](https://github.com/laravel-fans/laravel-docker/workflows/Laravel%2011/badge.svg)](https://github.com/laravel-fans/laravel-docker/actions/workflows/laravel-11.yml)

Full Laravel production and development environment for Docker, based on the official image `php:apache`.

## development or testing

It is recommended to use this docker image in your testing environment(amd64 or arm64, support Apple silicon), it contains git/jq/vim/nodejs/npm, and php extensions: gd/mysql/pgsql/redis/xdebug.

```shell
docker run -p 8000:80 -v $(pwd):/var/www/laravel laravelfans/laravel:11-dev
docker run -v $(pwd):/var/www/laravel -it laravelfans/laravel:10-dev bash
```

## production

It is recommended to use `Dockerfile` to build your own docker image in your production environment.

```shell
composer require --dev laravel-fans/docker
php artisan docker:publish
```

Then you will find `Dockerfile` in your project, so you can build:

```
docker build -t laravel-demo .
docker run -it laravel-demo
docker run -p 8000:80 -e "APP_ENV=local" -e "DB_CONNECTION=sqlite" \
-e "APP_KEY=base64:L+3avOYCfuq8nnDpHs74+5Et3sx27TssucHQIyqfpDY=" \
-it laravel-demo
```

Feel free to change the `Dockerfile`.

## screenshots

![docker run laravel](https://user-images.githubusercontent.com/4971414/126929099-20fee54e-89e8-4d52-8c04-41eeab7ede2d.png)