Use a scenario with 2-3 different containers e.g. web-app, database and cache, or load-balancer.
- Use nginx ...
- Something with postgres ...
- Or maybe sql-server ...
- Windows container legacy walkthrough ... (even worth checking it out)
Your procedure could look as follows
- Build a db container in other words choose your image
docker run -d --name=mongo mongodb
- You can also use RavenDb, MS-SQL, Postgres ... depending on your preference. But from a docker perspective it doesn't change too much :)
- Build your api-server image
- using .net core or nodejs (express) or what ever you like.
- Connect to two containers
- Define port mappings and link the two containers.
- But you will notice ... manual work is tedious .. but compose to the rescue :)
# basic compose cli
# building a compose file (using docker-compose.yml)
docker-compose build .
# build using different file name
docker-compose build -f my-compose.yml .
# starts your services interactive
docker-compose up .
# detached mode
docker-compose up -d .
# Stops containers and removes containers, networks, volumes, and images created by up
docker-compose down
# Removes stopped service containers
docker-compose rm
# for inspecting your service
docker-compose top
# "UI" to try out (portainer.io)
- https://portainer.io/install.html