Creating a Local Dev Environment for multiple websites

Good morning!

I have used WAMP for a long time for my development environment. I’ve recently (yesterday) decided to do away with that and begin using Docker for this since I am starting to require different php versions for some things.

I have been reading furiously over the past day on how to best setup a dev environment, but most of what I am seeing is about setting it up for one application, or multiple applications with the same requirements (ie…multiple wordpress sites).

Does anyone know of a good guide, or could possible help me figure this out on my own? I’m all for learning how to get it done, I just haven’t been able to find something that is recent and explains how to do this.

What I need:

All development files pulled from one local directory (c:\dev-env). This folder is where my git repos go for each project, so being able to use a reverse proxy to link each of the folders contained to foldername.local or something like that is really what I want.

However, I have static sites, wordpress sites, php sites, react apps, etc. So I guess I’m just having trouble wrapping my head around getting a single nginx server with a reverse proxy that can run all of the different setups.

I hope that made sense…

not sure about your usecase, but you can mount files into your docker container.
could mount c:\dev-env into /work for example.
And when you start your dev-env docker php container with --net=host , then you also do not need some reverse-proxy thing, i guess. But note, that --net=host isn’t something you should that much rely on. It’s quite dirty. But I think it could help you to get started.

My use case is:

I develop more than just php:

  1. Wordpress
    Static Websites
    React Apps
    Testing environments for other languages

So I want to have one folder (\dev-env) on my local machine that is used to house the direectories for all of these things. So when I make a new site, I can startup another docker instance and map the volume for it to \dev-env\newsite and then be able to access it via http://newsite.dev.

I believe this can be done via a reverse-proxy (looking at https://github.com/jwilder/nginx-proxy right now as it seems to be able to autodetect this).