0

I defined an additional service in my docker-compose.yml file in my Divio Cloud project.

Locally, it works just as expected. As well as the default web and db containers, I get my new container.

However, when I push this configuration to the Divio Cloud server, it's clearly not working at all, and I can't connect to the custom container.

Daniele Procida
  • 1,477
  • 10
  • 27

1 Answers1

0

In short

If you need an additional service in your project, you should configure it on the Divio Cloud, not in docker-compose.yml. docker-compose.yml is only used for local development purposes, and is ignored in deployment.

The longer answer

In Divio Cloud projects, docker-compose.yml is used to orchestrate all the services and containers in the local development environment only.

In the actual hosting environment, it's not used at all, and is simply ignored. Locally, your project has all the containers defined in the docker-compose.yml file - web, db and whatever else you define.

When your project is deployed on the hosting environment, only the web container is used.

The other containers are used locally for convenience, to replicate services that are part of the infrastructure.

For example, locally you have a db container running the Postgres database. In the cloud infrastructure, the web container connects to a Postgres cluster.

Similarly, if you have Celery in your cloud project, it will use backing services provided as part of the cloud infrastructure, but when you set up the same project locally, it will build them in new Docker containers.

More information at docker-compose.yml reference in the Divio Cloud Developer Handbook.


Note: I am a member of the Divio team. This question is one that we see quite regularly via our support channels.

Daniele Procida
  • 1,477
  • 10
  • 27