Skip to content

Files

Latest commit

f0411c6 · Nov 14, 2018

History

History
33 lines (28 loc) · 889 Bytes

README.md

File metadata and controls

33 lines (28 loc) · 889 Bytes

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'