• Welcome to the Chevereto user community!

    Here users from all over the world gather around to learn the latest about Chevereto and contribute with ideas to improve the software.

    Please keep in mind:

    • 😌 This community is user driven. Be polite with other users.
    • 👉 Is required to purchase a Chevereto license to participate in this community (doesn't apply to Pre-sales).
    • 💸 Purchase a Pro Subscription to get access to active software support and faster ticket response times.

Rodolfo

⭐ Chevereto Godlike
Chevereto Staff
Administrator
Hi there,

I'm posting to share my development setup and to share some thoughts about it. The idea is to show and tell and if you have your own custom stuff please share what you like (and hate) about it.

While I know that setup a production server is quite straightforward, development rigs are different. Usually, you include stuff like xDebug and most of the time you need quick changes. The idea is to develop fast and not spend 5 minutes changing the PHP version or something like that.

Wampserver (Windows)
About 5 years I used WAMP server which worked pretty nice before the PHP 5.4 era. Basically is a package that includes PHP + Apache binaries and using a menu on the taskbar you can control everything.

Pros
  • Easy and reliable, it just works
  • You configure everything from just one menu (multi-level menu)
Cons
  • They take a lot of time to build the binaries for newer versions, so you won't be able to play with the latest PHP unless you get the binaries on your own (probably you will need to compile it on your own)
  • You can't download extras (official stuff)

Devserver (Windows)
EasyPHP provides a product called devserver which is way more pluggable than wampserver as you can download different servers and libraries. You configure it via web and it gets frequent updates. They ask for a $10/year fee to access to all the pluggable stuff so it is really cheap for what you get.

Pros
  • Multiple servers (of any kind)
  • Easy configure an extend (check the warehouse)
Cons
  • I really miss the toolbar menu with access to all options. To configure this thing you have to go to the web dashboard and spend some time on it.
  • Some hard-coded variables like each vhost have a fixed prefix (edsa-) and stuff like that. Not a big deal for some, you can do this trick.
  • Hardcoded ports (I like my own custom ports if possible).

Vagrant (Multi)
Rather than relying on binaries, Vagrant uses virtualization to spawn a development environment. I checked Scotch Box which is a ready-to-go LAMP/LEMP stack but you can find countless stacks online. Basically, you get a virtualized machine configured as a development server.

Pros
  • No windows binaries, everything runs on Linux and yes, is not the same Windows/Linux on PHP
  • You get a production-like environment from scratch
Cons
  • No GUI. Everything gets made via command line
  • Slow hard drive speed. This was dead-end for me, it is ridiculously slow on Windows

Docker (Multi, Windows 10 Pro)
This is like the evolution of Vagrant in the form of containers. It is really amazing how Docker works and how easy deals with containers. Basically, it is a shared kernel but you define each component as a container. So you get a PHP container, an Apache container, MySQL and so on. Each container links based on your need which you can configure in a docker-compose file.

The power of the compose file is that you can target any container (remote) or even build your own container from scratch. This gives you full control with ease and since is a simple YAML file, you can create a bat or shell script that allows you to change PHP on the fly and issue all the commands on the fly.

Pros
  • Docker compose (easy to manage containers)
  • Powerful tools like command line access to logs and stuff like that
  • On Windows, you get Kitematict which is a GUI for containers
  • You can map any folder and it works really fast
  • Binds to PowerShell so you can do any kind of script for getting the server up, down, destroy, everything
Cons
  • On my setup, I got issues when running docker and turning off my computer. It seems to be a known issue since SEP 2017 and everytime that it happens, I've to remove everything and restart Docker. Is quite annoying on a daily basis
  • It needs Powershell so it won't work on Windows 10 Home
I really love docker and how easy it gets when you spend a good time learning it. I did my own server and nifty scripts to manage the server and the only thing that troubles me is the issue described above. Due to this, I'm using Devserver at this time because I don't have to worry to turn off Docker each time I want to turn off my computer.

So I have a Windows dev environment based on Devserver and I use docker to test the thing before going into the wild.

Hope it helps, feel free to share your thoughts and don't hesitate to share your development setup.

Cheers,
Rodolfo.
 
Great write up. And thank you for sharing.
I am also using docker for development on my system as well. It works great, and you can virtually create any stack you'd need for your development environment. It is so flexible and makes work easy.
Yes, the bug you mentioned is a huge nuisance, but I always kill the process before shutting down the computer, besides my computer is always on. So no worries.

Thank you once again.
 
I don't doubt that Docker will patch that thing in the short term. Maybe I can hook a task prior shutdown or something, I will investigate it further.
 
Please share your findings.
I would love to shutdown my pc without annoying myself to sleep. 😅
 
I've narrowed down the issue to bind mounts. Anytime I use bind mounts php+httpd fails to restart upon login/logoff. It seems that docker recognizes these mounts only when you do docker-compose up nor when the daemon starts.

If you use bind mounts then you are screwed up, you will need start Docker, restart it then start it again to fix it.
 
Hey, I found a way to fix it.

Updated 2018-02-08

1. Make sure that Docker for Windows is configured to autostart on login (Settings, General) and disable experimental features (Settings, Daemon).

2. On your project folder (where you have docker-compose.yml) create a .bat file containing this:

Code:
ping 127.0.0.1 -n 46 > nul

cd C:/Server
docker-compose stop
docker-compose down
docker-compose up -d --build
pause
Make sure to edit C:/Server to match your system.

3. Open the run Window (WIN + R) and enter shell:startup

4. Move the shortcut just created to the folder opened by the Run dialog.

5. Create a bat file with this command (use this to shutdown your PC):

Code:
shutdown.exe /s /t 0

When you log in this thing will issue the commands needed to get your server up and running. It will get rid of any conflict and you won't need to stop anything before shutting down your PC. Remeber to shutdown using that command, otherwise, it will break.

Most likely you will need some fine-tuning in the time you wait to chain these commands, in my setup 46 (minus 1 = 45) does the trick.

I know, is a dirty trick but is cheap and it works.
 
Thank you so much @Rodolfo :)
It did the trick. Turned off computer and it was shut down without any issues. It is a life saver.
Wish docker could implement something like this to solve the conflict.
 
Unfortunately for me, the fix didn't work all the time. MySQL was giving me issues due to driver firewall mapping. Turns out that the problem is Windows 10 Fall Creators Update as is described here: https://github.com/docker/for-win/issues/573#issuecomment-359162168

Basically, Windows now has some sort of hybrid poweroff that mess with Docker.

I've updated my patch with new instructions, hope it helps.
 
Back
Top