I have a data-config.json
that is used by my ASP.NET Core application.
The app was built to a image and the goal is to create a Kubernetes environment (using Minikube and a myapp.yaml to create and deploy the Minikube and the pods) and copy the data-config.json
from a specific place in my local machine to a directory in the Node (the place I want to be ~/app/publish/data-config.json
, in other words, in the root directory of the node).
I read a lot the documentation and I think ConfigMap can be useful in this case. I already implemented a Volume too. But I don't think write the json content inside the ConfigMap configuration is the best way to do that, I want to depend only of the data-config.json
file and the YAML.
In the docker-compose.yml
file, to test in Docker Desktop, it works and the code is showed above:
dataService:
image: webapp
build:
context: ../..
dockerfile: webapp
container_name: webapp-container
ports:
- "9000:8080"
volumes:
- "../data-service/data-config.json:/app/publish/data-config.json"
And it worked. Now I need to translate or find a way to copy this file and save it in the /app/publish/
directory of my node.