![]() You’ll need to use version 2 of the Compose file format. In this case, Docker Compose never creates the default network instead connecting the app’s containers to the i-already-created-this network. Version : ' 2' networks : default : external : name : i-already-created-this In the example below, we allow web to reach db via one of two hostnames ( db or database): Services on the same network can already reach one another. You may define additional aliases that services can use to reach one another. ![]() Containers with open connections to the old container close those connections, look up the new container by its name, and connect. The new container has a different IP address than the old one, but they have the same name. When you run docker-compose up to update the containers, Compose removes the old container and inserts a new one. You can change service configurations via the Docker Compose file. We can access web from the outside world via port 8000 on the Docker host (only because the web service explicitly maps port 8000. In our compose_django example, web can access the PostgreSQL database from postgres://postgres:5432. (In the event you need to run multiple projects on a single host, it’s recommended to set project names via the flag.) You can alter the network name with the -p or -project-name flags or the COMPOSE_PROJECT_NAME environment variable. 098520f7fce0 composedjango_default bridge
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |