Skip to content

Commit

Permalink
Update docker-compose.yml
Browse files Browse the repository at this point in the history
Named Volumes are managed by Docker and optimized for performance. Docker can manage the lifecycle and cleanup of volumes, unlike host-mounted directories that might require manual cleanup.
  • Loading branch information
yuvashrikarunakaran authored Dec 12, 2024
1 parent 8938054 commit 1303084
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions caching/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#

version: '3.7'
services:
mongodb_container:
Expand All @@ -33,4 +32,9 @@ services:
ports:
- '27017:27017'
volumes:
- ./mongo-data/:/data/db
- mongo-data:/data/db # Use a named volume

volumes:
mongo-data: # Declare the named volume


0 comments on commit 1303084

Please sign in to comment.