added mongo auth
This commit is contained in:
@@ -10,7 +10,8 @@
|
|||||||
"Bash(pip3 install:*)",
|
"Bash(pip3 install:*)",
|
||||||
"Bash(/Users/jeet/Library/Python/3.9/bin/pytest -v 2>&1)",
|
"Bash(/Users/jeet/Library/Python/3.9/bin/pytest -v 2>&1)",
|
||||||
"Bash(conda run:*)",
|
"Bash(conda run:*)",
|
||||||
"Bash(git rm:*)"
|
"Bash(git rm:*)",
|
||||||
|
"Bash(git remote:*)"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@@ -1,4 +1,4 @@
|
|||||||
from pydantic_settings import BaseSettings # type: ignore
|
from pydantic_settings import BaseSettings, SettingsConfigDict # type: ignore
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
|
|
||||||
|
|
||||||
@@ -9,9 +9,11 @@ class Settings(BaseSettings):
|
|||||||
environment: str = "development"
|
environment: str = "development"
|
||||||
frontend_url: str = "http://localhost:8000"
|
frontend_url: str = "http://localhost:8000"
|
||||||
|
|
||||||
class Config:
|
model_config = SettingsConfigDict(
|
||||||
env_file = ".env"
|
env_file=".env",
|
||||||
case_sensitive = False
|
case_sensitive=False,
|
||||||
|
extra="ignore", # ignore unknown env vars (e.g. VITE_* from root .env)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@lru_cache()
|
@lru_cache()
|
||||||
|
|||||||
@@ -37,11 +37,14 @@ services:
|
|||||||
|
|
||||||
mongo:
|
mongo:
|
||||||
image: mongo:6
|
image: mongo:6
|
||||||
command: ["mongod", "--bind_ip", "0.0.0.0"]
|
command: ["mongod", "--bind_ip", "0.0.0.0", "--auth"]
|
||||||
|
environment:
|
||||||
|
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
|
||||||
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
|
||||||
volumes:
|
volumes:
|
||||||
- mongo_data:/data/db
|
- mongo_data:/data/db
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"]
|
test: ["CMD", "mongosh", "--quiet", "-u", "${MONGO_USERNAME}", "-p", "${MONGO_PASSWORD}", "--authenticationDatabase", "admin", "--eval", "db.adminCommand('ping').ok"]
|
||||||
interval: 10s
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 5
|
retries: 5
|
||||||
|
|||||||
Reference in New Issue
Block a user