Why another docker-compose file? After a catastrophic hardware failure and dev machine replacement, I opted to try the docker route.
The aim of cdf-local is to make [re]configuring my development environment easier as well as have the ability to control local data services with a single "docker-compose
" command. The initial version uses docker-compose
, though a kubernetes approach is being considered. As this is my first attempt using docker containers on my dev machine, I'll be looking for more efficient ways in the future. [Any suggestions would be appreciated.]
These containers are focused on providing the data foundation used in my development environment and will be modified as needed. They are common services I add to many of my projects. I've often at times also just need a data-store to test against without an actual application. So instead of installing all the services locally on my dev machine, I've used docker containers. Of course, my projects that rely on custom resources have those specifics added as needed. Note: This was created on a Windows 10 machine, so it has not yet been tested on other platforms.
Pre-reqs: Docker (and docker-compose) should be set up and running correctly.
- Clone the cdf-local repo to your local drive.
- Create a new external network using docker:
docker network create cdflocal-mesh
. - Change the default user names or passwords in the .env file.
- In the
./server-conf/redis
folder, modify the redis.conf file as desired. - In the
./server-conf/mongo/docker-entrypoint-initdb.d
folder, modify the mongo-init.js file as desired. - Update the various
docker-config
files as needed. - Run the
./docker-up.ps1
script to executedocker compose up --build
on the compose files. - Run the
./docker-down.ps1
script to shut down all containers as needed.
- docker-compose-data.yml
- Microsoft SQL Server
- mongo
- redis
- "alpine helper layer", addresses (THP issues)
- docker-compose-support.yml
- docker-compose-azure.yml
- Azure Blob Storage Emulator via Azureite
- docker-compose.yml
- Used for testing individual resources.
This PowerShell helper script can be used to build or start (docker compose up
) all containers. Switches:
-BuildOnly:$true
, executesdocker compose build
instead ofdocker compose up
-Azure:$true
, adds docker-compose-azure.yml file to thedocker compose up
command-Force:$true
, appends--force-recreate --renew-anon-volumes
to thedocker compose up
command-Detach:$true
, appends--detach
to thedocker compose up
command
The companion files ...
docker-down.ps1
runs docker compose down
on all containers,
docker-stop.ps1
runs docker compose stop
on all containers.
Thanks to all the old-hats out there that have been blogging for years and the official sites/documentation that exists. Though this took me a bit longer than I initially forecast, the learning was worth it. Other than the official doc sites, here is a list of sites that continue to assist me in my journey:
- Defining your multi-container application with docker-compose.yml
- A Linux Dev Environment on Windows with WSL 2, Docker Desktop and More
- How to link multiple docker-compose services via network
- How to split your huge Docker Compose into multiple files?
- Docker-Compose mongoDB Prod, Dev, Test
- MongoDB container with Docker Compose
- How To Configure Redis + Redis Commander + Docker
- Install and run the Azurite Docker image
- eShopOnContainers