Skip to content

Commit

Permalink
Run init script at startup when db changed
Browse files Browse the repository at this point in the history
following from this:
https://stackoverflow.com/questions/56476339/recreation-of-mongodb-container-doesnt-re-run-config-js-file-in-docker-entrypoin
the init script is only run at start. This makes it run for both BEs but
in a later PR we should understand how to rerun it when any seed changes
  • Loading branch information
minottic committed Apr 8, 2024
1 parent a5ece6b commit 8642726
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions services/mongodb/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ services:
mongodb:
image: mongo:7.0
volumes:
- mongodb_data:/data/db
- ${BE_VERSION:-backendnext}_mongodb_data:/data/db
- ./config/init.js:/docker-entrypoint-initdb.d/init.js
- ./config/seed:/seed
environment:
BE_VERSION: ${BE_VERSION:-backendnext}

volumes:
mongodb_data:
$BE_VERSION_mongodb_data:
driver: local
backend_mongodb_data:
driver: local

0 comments on commit 8642726

Please sign in to comment.