DevPot - For a clean and fast development environment.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
conf
test/php
.env.dist
.gitignore
.travis.yml
LICENSE
README.md
_config.yml
docker-compose.yml
logo.svg

README.md

DevPot

For a clean and fast development environment

Build Status

Table of Contents

Introduction

DevPot is a new version of Maxlab Stacker.

Requirements

Installation

Get DevPot:

$ git clone https://github.com/Arbarwings/devpot.git
# OR
$ git clone git@github.com:Arbarwings/devpot.git

Run in DevPot directory

# make a symbolic link to your folder with all your projects 
$ ln -s /your_path/to_all_your_own_projects ./workspace
# copy .env.dist to .env and change it
$ cp .env.dist .env
# Add docker group
$ sudo groupadd docker
# Add your user to the docker group
$ sudo usermod -aG docker $USER
# Now restart? Or find an other way to complete the usermod changes
$ docker-compose build && docker-compose up -d && docker-compose ps
$ sudo apt-get update && sudo apt-get install dnsmasq
$ mv ./test ./workspace
# Then open http://php.test.dev/ in your browser

Set local DNS server

Run Docker as non root

  • Create the docker group.
$ sudo groupadd docker
  • Add your user to the docker group.
$ sudo usermod -aG docker $USER
  • Log out and log back in so that your group membership is re-evaluated.

Move your projects

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

On the ship

  • mailcatcher -> schickling/mailcatcher:latest (all outgoing mail is sent to http://mail.dev/)
  • nginx -> nginx:stable
  • mysql -> mysql:latest
  • pgsql -> postgres:latest
  • php7xdebug -> php:7.2 + xdebug
  • dnsmasq -> dnsmasq:latest
  • php7console -> devpot console
  • redis -> redis:latest
  • phpmyadmin -> phpmyadmin:latest (http://phpmyadmin.dev)
  • mongodb -> mongodb:latest

Console

  • ZSH + oh-my-zsh
  • For frontend: nodejs, gem, npm, webpack, bower, gulp, uglify-js, uglifycss, create-react-app
  • For backend: composer, php, phpunit, autocomplete
  • For automation deploy: dep (Deployer)

Create a Self-Signed Certificate

$ devpot create-certificate test # Replace test with your domain

FAQ

Which settings in the configs for my projects?

  • Database
    • You can access the database in your app config use db for mysql and pgsql for postgresql (files will be saved in the mysql directory so it will be saved after destroying or recreating the containers)
      # Example for mysql
      parameters:
        database_host: mysql
        database_port: 3306
        database_name: sf
        database_user: root
        database_password: root
    
      # Example for pgsql
      parameters:
        database_host: pgsql
        database_port: 5433
        database_name: sf
        database_user: postgres
        database_password: postgres
      
      # Example for redis
      parameters:
        database_host: redis
        database_port: 6379

What external ports are listening images?

  • It's easy. For convenience, the external ports of the databases are offset by plus one. For example, MySQL listens to port 3306 + 1 = 3307 and so on...
  • Check the file docker-compose.yml for more

Xdebug + PhpStorm configuration

  1. Go to Settings -> Languages & Frameworks -> PHP
  2. Click the ... behind your interperter

How to contact the any instances DevPot in console?

You can do so:

$ /your_path/to_devpot_folder/bin/devpot console

But, it will be much better:

# for bash
$ echo 'export PATH=/your_path/to_devpot_folder/bin:$PATH' >> ~/.bashrc && source ~/.bashrc 
# for ~/.zshrc
$ echo 'export PATH=/your_path/to_devpot_folder/bin:$PATH' >> ~/.zshrc && source ~/.zshrc
# then restart console and run
$ devpot console

Laravel5 completion

$ devpot console
$ cd to_laravel5_folder
$ la5 [tab*2]

Commands

$ devpot usage # for list available commands
$ devpot console # for enter to console
$ devpot logs <cont_name> -f # for logs stream container
$ devpot build && devpot down && devpot up && devpot ps # for full rebuild