[PR #310] [MERGED] Remove container_name to allow multiple apps in parallel #376

Closed
opened 2025-11-06 14:24:54 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/docker/awesome-compose/pull/310
Author: @StefanScherer
Created: 11/23/2022
Status: Merged
Merged: 12/8/2022
Merged by: @milas

Base: masterHead: remove-react-mongo-container-name


📝 Commits (1)

  • ec7d18d Remove container_name to allow multiple apps

📊 Changes

2 files changed (+0 additions, -4 deletions)

View changed files

📝 react-express-mongodb/.docker/docker-compose.yaml (+0 -1)
📝 react-express-mongodb/compose.yaml (+0 -3)

📄 Description

During a test I wanted to create a second dev environment for the react-express-mongo example, but it failed, because the container name "mongo" is already in use by a stopped other dev env.

Screenshot 2022-11-23 at 11 33 05

I suggest to remove the container_name from the Docker Compose file, because Compose automatically assigns the service name and service lookup via host names work fine. The whole app still works fine.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/docker/awesome-compose/pull/310 **Author:** [@StefanScherer](https://github.com/StefanScherer) **Created:** 11/23/2022 **Status:** ✅ Merged **Merged:** 12/8/2022 **Merged by:** [@milas](https://github.com/milas) **Base:** `master` ← **Head:** `remove-react-mongo-container-name` --- ### 📝 Commits (1) - [`ec7d18d`](https://github.com/docker/awesome-compose/commit/ec7d18db3155183a8ca00ff08d0c8c860fe2c744) Remove container_name to allow multiple apps ### 📊 Changes **2 files changed** (+0 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `react-express-mongodb/.docker/docker-compose.yaml` (+0 -1) 📝 `react-express-mongodb/compose.yaml` (+0 -3) </details> ### 📄 Description During a test I wanted to create a second dev environment for the react-express-mongo example, but it failed, because the container name "mongo" is already in use by a stopped other dev env. <img width="1920" alt="Screenshot 2022-11-23 at 11 33 05" src="https://user-images.githubusercontent.com/207759/203528799-1cf57f1a-cd4d-4354-85f1-52e783a1946d.png"> I suggest to remove the `container_name` from the Docker Compose file, because Compose automatically assigns the service name and service lookup via host names work fine. The whole app still works fine. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-06 14:24:54 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/awesome-compose#376