Docker-compose.yml vs okteto.yml

Can someone explain why we need both docker-compose.yml as well as okteto.yml in same project: GitHub - okteto/python-getting-started: Develop Python Apps in Kubernetes with Okteto? okteto deploy uses which file? From my understanding if Docker-compose is present it will use that, if not then it uses okteto.yml or generates one. In our case we have local.yml and production.yml as we used cookiecutter-django which templates these so which way do we go? Or we use both

If moving from an existing docker-compose to okteto, the depends_on is also used in okteto.yml I assume

You don’t need to have both files. Okteto gives you the following options:

  1. Just your docker-compose.yaml: If you only have a docker-compose.yaml at the root of your repository, the okteto build, okteto deploy and okteto up commands will automatically use it. This is great for the case where you have a simple docker-compose application.
  2. A docker-compose.yaml and okteto.yaml: Use this when you want to have more control over how okteto build will build your images, okteto deploy will launch your services, or how to develop the services using okteto up. This is great when you want to create other services besides what is defined on your compose, when you have more than one compose file on your repo, or if you want to customize the development experience with a different container image.

Docker Compose on Kubernetes with Okteto | Okteto Documentation and Docker Compose Reference | Okteto Documentation have more information and examples on this.

1 Like