diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..688aaf1 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +* +!poetry* +!pyproject.toml +!.env +!ezar diff --git a/.gitignore b/.gitignore index e4d5f8d..b44c918 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ __pycache__ .venv .env .vscode +mongo_data/ diff --git a/docker-compose.yml b/docker-compose.yml index 65bddcb..7cab363 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,3 +8,18 @@ services: build: context: . dockerfile: Dockerfile + links: + - mongodb + environment: + MONGO_URI: mongodb://ezar:WhatAShame@mongodb:27017/eZaR + mongodb: + image: mongo:6.0 + environment: + MONGO_INITDB_DATABASE_USERNAME: ezar + MONGO_INITDB_DATABASE_PASSWORD: WhatAShame + MONGO_INITDB_DATABASE: eZaR + expose: + - 27017 + volumes: + - ./mongo_data:/data/db + - ./mongo_init.js:/docker-entrypoint-initdb.d/init.js:ro diff --git a/mongo_init.js b/mongo_init.js new file mode 100644 index 0000000..4c157f5 --- /dev/null +++ b/mongo_init.js @@ -0,0 +1,10 @@ +db.createUser({ + user: "ezar", + pwd: "WhatAShame", + roles: [ + { + role: "readWrite", + db: "eZaR", + }, + ], +});