PHPackages                             reflexions/docker-laravel-fedora - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [DevOps &amp; Deployment](/categories/devops)
4. /
5. reflexions/docker-laravel-fedora

ActiveLibrary[DevOps &amp; Deployment](/categories/devops)

reflexions/docker-laravel-fedora
================================

Provides Docker and Elastic Beanstalk integration for a Laravel 5 project

31.x-dev(6y ago)3443LGPL-2.1-or-laterShellPHP &gt;=7.2

Since Mar 16Pushed 2mo ago4 watchersCompare

[ Source](https://github.com/reflexions/docker-laravel-fedora)[ Packagist](https://packagist.org/packages/reflexions/docker-laravel-fedora)[ RSS](/packages/reflexions-docker-laravel-fedora/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (10)Used By (0)

### reflexions/docker-laravel-fedora

[](#reflexionsdocker-laravel-fedora)

by [Reflexions](https://reflexions.co)

- Only depends on Docker
- Edit with Sublime, PhpStorm, Eclipse, etc
- Installs everything necessary to get started - laravel, php, database, imagemagick
    - Can start with empty directory or existing laravel project
    - No need to install PHP via homebrew / MacPorts / .MSI / apt-get / yum / etc
- Addresses permissions errors without requiring `chmod 777`

#### Instructions

[](#instructions)

1.) Install [Docker](https://www.docker.com/community-edition#/download) to get docker, docker-compose, and the Kitematic GUI. Open a terminal with the docker env variables via `Kitematic -> File -> Open Docker Command Line Terminal`

2.) Create a *docker-compose.yml* and *docker-compose.override.yml* in the project directory. Define the laravel service and any desired database services:

##### docker-compose.yml

[](#docker-composeyml)

```
version: '3'
services:
  laravel:
    image: reflexions/docker-laravel-fedora:9
    env_file: .env
    links:
      - database

  database:
    image: postgres:13
    env_file: .env
    environment:
      LC_ALL: C.UTF-8
```

The override file shouldn't be committed to git. It's for settings that differ between environments.

##### docker-compose.override.yml

[](#docker-composeoverrideyml)

```
version: '3'
services:
  laravel:
    ports:
      - "80:80"
    volumes:
      - .:/var/www/laravel

  database:
    ports:
      - "5432:5432"
```

3.) Create an *.env* file in the project directory.

The `database` service above corresponds to `DB_HOST=database` below. You'll have to fill in the blanks in the .env example:

```
# laravel service
APP_KEY=
DB_CONNECTION=pgsql
DB_HOST=database
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=

# database service
POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=
```

4.) Obtain a [Github Personal Access Token](https://github.com/settings/tokens/new). Provide that in the GITHUB\_TOKEN env var

Alternatively, create a GitHub user and ssh key that are only used by builds, and cp that to /root/.ssh/id\_rsa

4.) With one command download the images, create the service containers, and start the application:

```
docker-compose up
```

5.) (optional) APP\_KEY

```
$ docker exec -it $(docker ps | grep reflexions/docker-laravel | awk '{print $1}') bash
root@4c0491540409:/var/www/laravel# php artisan key:generate
```

6.) (optional) Tinker

```
$ docker exec -it $(docker ps | grep reflexions/docker-laravel | awk '{print $1}') bash
root@4c0491540409:/var/www/laravel# php artisan tinker
```

#### Overview

[](#overview)

- Runs setup script first time
- Uses github credentials to avoid composer rate limit errors
- Downloads fresh laravel 5.4 if the *app* directory is missing
- Adds dependency on `reflexions/docker-laravel-fedora` composer package
- Updates *bootstrap/app.php* to use `Reflexions\DockerLaravel\DockerApplication` to prevent permissions errors

#### Front-end build systems

[](#front-end-build-systems)

These (webpack, gulp, etc) should be configured in your project's Dockerfile

#### Elastic Beanstalk

[](#elastic-beanstalk)

Add a *Dockerfile* to the root of the project to deploy with Elastic Beanstalk:

```
FROM reflexions/docker-laravel-fedora:latest

MAINTAINER "Your Name"

RUN /usr/share/docker-laravel-scripts/setup.sh

COPY . /var/www/laravel
WORKDIR /var/www/laravel

EXPOSE 80
ENTRYPOINT ["/usr/share/docker-laravel/bin/start.sh"]

```

This will define an application container. Use RDS to create the database. Add all variables from the *.env* file (including the APP\_KEY, DB\_HOST, etc) into the `AWS Management Console` -&gt; `Elastic Beanstalk` -&gt; `Your-Environment` -&gt; `Configuration` -&gt; `Software Configuration`.

#### Troubleshooting

[](#troubleshooting)

##### **Problem:** Mac OS X: Couldn't connect to docker daemon

[](#problem-mac-os-x-couldnt-connect-to-docker-daemon)

```
$ docker-compose up
ERROR: Couldn't connect to Docker daemon - you might need to run `docker-machine start default`.
$
```

***Solution:*** Open terminal with `Kitematic -> File -> Open Docker Command Line Terminal`.

##### **Problem:** Don't like the Docker Command Line Terminal

[](#problem-dont-like-the-docker-command-line-terminal)

***Solution:*** Run `Kitematic -> Install Docker Commands`. Then add the following line *~/.bash\_profile*:

```
eval "$(docker-machine env dev)"
```

##### **Problem:** Changes to *.env* file apparently ignored by laravel

[](#problem-changes-to-env-file-apparently-ignored-by-laravel)

***Solution:*** Restart cluster. Settings in the *.env* file are only read on start.

```
$ docker-compose restart
```

##### **Problem:** Mac OS X: Illegal Instruction 4

[](#problem-mac-os-x-illegal-instruction-4)

```
$ docker-compose up
Illegal instruction: 4
$
```

***Solution:*** Known issue with the Docker Toolbox on older CPUs. Install docker-compose using pip

##### **Problem:** Can't connect to database

[](#problem-cant-connect-to-database)

***Solution:***

- Check that the DB\_CONNECTION corresponds to the correct laravel db driver
- Check that the DB\_HOST corresponds to the name of the service listed in docker-compose.yml (i.e. "database" in the example above)

##### **Problem:** RuntimeException: No supported encrypter found. The cipher and / or key length are invalid.

[](#problem-runtimeexception-no-supported-encrypter-found-the-cipher-and--or-key-length-are-invalid)

***Solution:***

- Run `php artisan key:generate` to update APP\_KEY on .env, then restart the container.

##### **Problem:** Want to use mysql instead of postgres

[](#problem-want-to-use-mysql-instead-of-postgres)

***Solution:***

- Modify `docker-config.yml` to reference MySQL:

```
version: '3'
services:
  laravel:
    image: reflexions/docker-laravel-fedora:26
    env_file: .env
    links:
      - database

  database:
    image: mysql:5.6
    env_file: .env
    environment:
      LC_ALL: C.UTF-8
```

##### docker-compose.override.yml

[](#docker-composeoverrideyml-1)

```
version: '3'
services:
  laravel:
    ports:
      - "80:80"
    volumes:
      - .:/var/www/laravel

  database:
    ports:
      - "3306:3306"
```

- Modify `.env` to reference MySQL:

```
DB_CONNECTION=mysql

# database service
MYSQL_ROOT_PASSWORD=
MYSQL_DATABASE=
MYSQL_USER=
MYSQL_PASSWORD=
```

##### **Problem:** Want to use mysql already running on local machine (not docker)

[](#problem-want-to-use-mysql-already-running-on-local-machine-not-docker)

***Solution:***

- Modify `docker-config.yml` to remove references to database
- Modify `.env` to connect to MySQL via the docker-machine host ip address (192.168.99.1):

```
DB_CONNECTION=mysql
DB_HOST=192.168.99.1
DB_DATABASE=
DB_USERNAME=
DB_PASSWORD=
```

- Ensure that "bind\_address" config parameter is set to 0.0.0.0 on startup. This can be set by your `my.cnf`, or it can be hard coded in your startup script. To check the value use this sql:

```
show variables like 'bind_address';
```

- Ensure that the database username has permission to connect from the docker container (usually 192.168.99.100)

```
CREATE USER 'username'@'192.168.99.100' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON application.* TO 'username'@'192.168.99.100';
FLUSH PRIVILEGES;
```

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance56

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~295 days

Recently: every ~344 days

Total

6

Last Release

1007d ago

Major Versions

30.x-dev → 31.x-dev2019-10-29

8.1.x-dev → 9.1.x-dev2023-07-17

8.x-dev → 9.x-dev2023-08-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/6bbe6abe6a6d886c40b06bcac1be55a5ac542d0924baac1978b16a97c0c26b47?d=identicon)[gregreflexions](/maintainers/gregreflexions)

![](https://avatars.githubusercontent.com/u/4991937?v=4)[Alex Smith](/maintainers/alex38)[@alex38](https://github.com/alex38)

---

Top Contributors

[![gregmartyn](https://avatars.githubusercontent.com/u/974822?v=4)](https://github.com/gregmartyn "gregmartyn (113 commits)")

### Embed Badge

![Health badge](/badges/reflexions-docker-laravel-fedora/health.svg)

```
[![Health](https://phpackages.com/badges/reflexions-docker-laravel-fedora/health.svg)](https://phpackages.com/packages/reflexions-docker-laravel-fedora)
```

###  Alternatives

[deployer/deployer

Deployment Tool

11.0k25.4M207](/packages/deployer-deployer)[appwrite/server-ce

End to end backend server for frontend and mobile apps.

55.3k84.2k](/packages/appwrite-server-ce)[pragmarx/health

Laravel Server &amp; App Health Monitor and Notifier

2.0k1.0M2](/packages/pragmarx-health)[felixfbecker/language-server-protocol

PHP classes for the Language Server Protocol

22476.7M6](/packages/felixfbecker-language-server-protocol)[heroku/heroku-buildpack-php

Toolkit for starting a PHP application locally, with or without foreman, using the same config for PHP and Apache2/Nginx as on Heroku

8161.3M10](/packages/heroku-heroku-buildpack-php)[tiamo/phpas2

PHPAS2 is a php-based implementation of the EDIINT AS2 standard

4674.7k](/packages/tiamo-phpas2)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
