Skip to content

Commit b953a19

Browse files
author
izoldik
committed
config mongo in compose: adding env vars
1 parent 70b23b9 commit b953a19

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.env

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Docker-compose env variables
22
POSTGRES_PORT=5555
3-
POSTGRES_PASSWORD=qwerty
3+
POSTGRES_PASSWORD=qwerty
4+
MONGODB_PORT=27017
5+
MONGODB_PASSWORD=sosibibu

docker-compose.yaml

+5-1
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,12 @@ services:
1919
mongo:
2020
image: mongo:7.0
2121
container_name: mongo
22+
environment:
23+
MONGO_INITDB_DATABASE: "problems"
24+
MONGO_INITDB_ROOT_USERNAME: "problems"
25+
MONGO_INITDB_ROOT_PASSWORD: "${MONGODB_PASSWORD}"
2226
ports:
23-
- "27017:27017"
27+
- "${MONGODB_PORT}:27017"
2428
networks:
2529
- backend-services
2630

0 commit comments

Comments
 (0)