Skip to content

OpenStock is an open-source alternative to expensive market platforms. Track real-time prices, set personalized alerts, and explore detailed company insights — built openly, for everyone, forever free.

Add MongoDB service to docker-compose

Mr. Algorithm53d26a8693e9
diff --git a/docker-compose.yml b/docker-compose.yml
index 644a09a..b08fe1a 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -6,3 +6,25 @@ services:
env_file:
- .env
restart: unless-stopped
+ depends_on:
+ - mongodb
+
+ mongodb:
+ image: mongo:7
+ container_name: mongodb
+ restart: unless-stopped
+ environment:
+ MONGO_INITDB_ROOT_USERNAME: root
+ MONGO_INITDB_ROOT_PASSWORD: example
+ ports:
+ - "27017:27017"
+ volumes:
+ - mongo-data:/data/db
+ healthcheck:
+ test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
+ interval: 10s
+ timeout: 5s
+ retries: 5
+
+volumes:
+ mongo-data: