Coder Social home page Coder Social logo

php-docker's Introduction

Docker for PHP

This is a development environment for PHP. It contains,

  • PHP-FPM
  • GD
  • Composer
  • Xdebug
  • Npm/Vue

Installation

Requirements

  • You need to have Docker installed

Copy .env.example to .env

Run in root folder,

docker-compose build && docker-compose up -d

Login to the container,

docker exec -it app_fpm /bin/bash

or in PHPstorm. In docker services choose app_fpm container. Right click and click exec. Add

/bin/bash

Project files will be in data/www

Create Laravel project

cd www
rm index.php
composer create-project --prefer-dist laravel/laravel .

Serve

php artisan serve --host 0.0.0.0

Setup PHPStorm for PHPUnit https://blog.jetbrains.com/phpstorm/2016/11/docker-remote-interpreters/

First you must build and run the container

We can add a new interpreter from the preferences pane, by selecting Languages & Frameworks, then PHP, and clicking the [โ€ฆ] button next to the interpreter drop down. Next, we click the [+] button to add a new interpreter and select Remote.

Serve npm

To change host and port of npm run server, Go to package.json and change scripts/serve to

"serve": "vue-cli-service serve --host 0.0.0.0 --port 8000",

php-docker's People

Contributors

ikiranis avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.