For a clean and fast development environment
DevPot is a new version of Maxlab Stacker.
- Install Docker
- Install Docker Compose > 1.20.0
$ git clone https://github.com/Arbarwings/devpot.git
# OR
$ git clone git@github.com:Arbarwings/devpot.git
# 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
$ mv ./test ./workspace
# Then open http://php.test.localhost/ in your browser
- 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.
- Add your project in workspace folder
./workspace/<customer>/<projectname>
(no need to restart, this will work out of the box) - Open http://project.customer.localhost/ in your browser (if you do not have dnsmasq, you have to add your hosts file manually)
- mailcatcher -> schickling/mailcatcher:latest (all outgoing mail is sent to http://mail.localhost/)
- nginx -> nginx:stable
- mysql -> mysql:latest
- php7xdebug -> php:7.3 + xdebug
- dnsmasq -> dnsmasq:latest
- php7console -> devpot console
- redis -> redis:latest
- phpmyadmin -> phpmyadmin:latest (http://phpmyadmin.localhost)
- ZSH + oh-my-zsh
- For backend: composer, php, phpunit, autocomplete
- For automation deploy: dep (Deployer)
$ devpot create-certificate test # Replace test with your domain
- Database
- You can access the database in your app config use
db
for mysql andpgsql
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 redis parameters: database_host: redis database_port: 6379
- You can access the database in your app config use
- 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
- Go to Settings -> Languages & Frameworks -> PHP
- Click the ... behind your interperter
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
$ devpot console
$ cd to_laravel5_folder
$ la5 [tab*2]
$ 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