Giter Club home page Giter Club logo

stacker's Introduction

Stacker - Symfony docker starter kit for development

Build Status

Quickly start of developing locally with Nginx, PHP7, Mysql, Pgsql, Mailcatcher and Redis. No e-mail is send externally, everything is catched by mailcatcher.

Base images

Currently the next images are used. Trying to rely on official images as much as possible.

  • mailcatcher -> schickling/mailcatcher:latest
  • nginx -> nginx:1.10.1
  • mysql -> mysql:5.7
  • php7xdebug -> need for interpreter phpstorm and other
  • php7 -> need for container, includes gem, npm, bower, gulp, composer
  • redis -> redis:3.0

Installation

Before

Tested under Linux. For Windows/Mac, take a look at the docker beta(heard that good performances are met) Stop all other local Webservers running on port 80/443.

Set-up your database credentials in the conf directory (OPTIONAL)

  • conf/mysql
  • conf/pgsql

Start

  • Run in Stacker direcory
    • $ docker-compose build
    • $ docker-compose up -d
    • $ docker-compose ps
  • *.dev > 127.0.0.1 (if you use boot2docker, use that ip)
    • sudo apt-get update && sudo apt-get install dnsmasq add a file /etc/dnsmasq.d/dev.conf with address=/.dev/127.0.0.1
    • move ./test to ./workspace
    • (if need) hosts
      • add 127.0.0.1 test.project.dev to your hosts file /etc/hosts
      • add 127.0.0.1 mail.dev to your hosts file /etc/hosts
  • all outgoing mail is sent to http://mail.dev/

For pure PHP

  • add your project in workspace folder ./workspace/<customer>/<projectname>/htdocs (no need to restart, this will work out of the box)
  • open http://customer.project.dev/ in your browser (if you do not have dnsmasq, you have to add your hosts file manually). For Symfony2
  • add your Sf2 project in workspace folder ./workspace/<customer>/<projectname> (no need to restart, this will work out of the box)
  • open http://customer.project.dev/ in your browser (if you do not have dnsmasq, you have to add your hosts file manually).

Database

  • Set the desired root password in the conf/mysql section. To manage database run ./bin/dev myroot
  • You can access the database in your app use db as hostname.
  • Files will be saved in the mysql directory so it will be saved after destroying or recreating the containers.

Redis

To use redis, use redis as hostname in the config of your app.

Console

If you want run a console to run php commands.

  • ./bin/dev console - PHP7, gem, npm, bower, gulp, composer

How to

  • Configure local wildcard DNS server(for linux)

    • Install Dnsmasq: sudo apt-get install dnsmasq
    • Since Ubuntu's NetworkManager uses dnsmasq, and since that messes things up a little for us, open up /etc/NetworkManager/NetworkManager.conf and comment out (#) the line that reads dns=dnsmasq. Restart NetworkManager afterwards: sudo restart network-manager.
    • Make sure Dnsmasq listens to local DNS queries by editing /etc/dnsmasq.conf, and adding the line listen-address=127.0.0.1.
    • Create a new file in /etc/dnsmasq.d (eg. /etc/dnsmasq.d/dev.conf), and add the line address=/.dev/127.0.0.1 to have dnsmasq resolve requests for *.dev domains. Restart Dnsmasq: sudo /etc/init.d/dnsmasq restart.
  • xDebug + PhpStorm configuration Watch this video https://youtu.be/RdmcGAAQGfI -dinclude_path=./:/usr/local/lib/php:/root/.composer/vendor/phpunit

  • I have a lot of the Symphony project, is it possible to make a symbolic link to them?

    • Yes! It's much faster and easier, plus no need to move folders from the usual places.
    • In the directory with your projects, create a folder and copy all the projects from the Symphony code. Now, make a link to your directory project in the directory with the Stacker, remove a directory ./workspace and rename your link to workspace - that's all! Now all your Symphony projects is available from the browser.

stacker's People

Contributors

maxlab avatar

Watchers

 avatar  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.