Hey folks,
Iβm working on a small side project built around a microservices architecture β a few API services, some databases, nothing huge. The folder structure looks like this:
~/myProject/
βββ docker-compose.yml
βββ .git/
βββ service-a/
βββ service-b/
βββ service-c/
When I run everything with docker-compose up, my code is on my own local machine, but dependencies live inside the containers, so VS Code keeps throwing lint/type errors (since node_modules or pip packages arenβt on my local machine).
If I try using Dev Containers and attach directly to a service, it works better β except that the .git folder isnβt mounted inside the container, so Git integration (history, branches, etc.) breaks inside VS Code. So my questions are:
- How do you handleβ¦
Hey folks,
Iβm working on a small side project built around a microservices architecture β a few API services, some databases, nothing huge. The folder structure looks like this:
~/myProject/
βββ docker-compose.yml
βββ .git/
βββ service-a/
βββ service-b/
βββ service-c/
When I run everything with docker-compose up, my code is on my own local machine, but dependencies live inside the containers, so VS Code keeps throwing lint/type errors (since node_modules or pip packages arenβt on my local machine).
If I try using Dev Containers and attach directly to a service, it works better β except that the .git folder isnβt mounted inside the container, so Git integration (history, branches, etc.) breaks inside VS Code. So my questions are:
- How do you handle this local vs container dev setup cleanly?
- Any best practices for microservice development with Docker Compose + VS Code Dev Containers?
- Should I just mount the whole project, including
.git, into the containers? - Maybe set up multi-stage Dev Containers?
- Or is it better to keep containers running but code outside and sync changes somehow?
- Or something else?
Would love to see how others structure their setups
Thanks in advance!