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

https://github.com/zoispag/dockerize_php

Opinionated ready-to-use docker for PHP (Laravel) apps
https://github.com/zoispag/dockerize_php

docker docker-compose docker-container laravel mailcatcher mysql nodejs php

Last synced: 3 months ago
JSON representation

Opinionated ready-to-use docker for PHP (Laravel) apps

Awesome Lists containing this project

README

          

# Docker for PHP

> Opinionated ready-to-use docker for PHP (Laravel) apps

### Contains:
- nginx
- php-fpm (php 7.2)
- mysql 5.6
- mailcatcher
- composer
- node.js
- php extensions: mysql & sqlite3

### Env variables:
- Set APP_PORT to access the app from `localhost:MYSQL_PORT`
- Set MYSQL_PORT to access the sql database with SequelPro with `host = localhost` and `port = MYSQL_PORT`

### Setup:
- Put your PHP app inside the `workspace` dir
- `cd deployment && cp .env.example .env`
- Set your environment variables
- Execute `docker-compose build` from the `deployment` dir
- Once finished, run `docker-compose up -d` to start the containers
- First time run will take longer (some images will have to download)

#### Useful aliases:
```
dup='docker-compose up -d'
ddown='docker-compose down'
dps='docker-compose ps'
drr='ddown && dup'
dphp='docker exec -it php-server /bin/bash'
```