chore(docker): conteneurs mysql et mongo dédiés avec volumes nommés
This commit is contained in:
1 parent
2ec13f5895
commit
0e714f507b
1 file changed
+43
@@ -0,0 +1,43 @@
|
||||
services:
|
||||
mysql:
|
||||
image: mysql:8.4
|
||||
container_name: flashcards-mysql
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: root
|
||||
MYSQL_DATABASE: flashcards
|
||||
MYSQL_USER: flashcards
|
||||
MYSQL_PASSWORD: flashcards
|
||||
ports:
|
||||
- "13306:3306"
|
||||
volumes:
|
||||
- flashcards-mysql-data:/var/lib/mysql
|
||||
- ./docker/init/mysql:/docker-entrypoint-initdb.d:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-uroot", "-proot"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
|
||||
mongo:
|
||||
image: mongo:8
|
||||
container_name: flashcards-mongo
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MONGO_INITDB_ROOT_USERNAME: flashcards
|
||||
MONGO_INITDB_ROOT_PASSWORD: flashcards
|
||||
MONGO_INITDB_DATABASE: flashcards
|
||||
ports:
|
||||
- "127017:27017"
|
||||
volumes:
|
||||
- flashcards-mongo-data:/data/db
|
||||
- ./docker/init/mongo:/docker-entrypoint-initdb.d:ro
|
||||
healthcheck:
|
||||
test: ["CMD", "mongosh", "--quiet", "--eval", "db.runCommand({ ping: 1 })"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
|
||||
volumes:
|
||||
flashcards-mysql-data:
|
||||
flashcards-mongo-data:
|
||||
Reference in new issue
Block a user