Skip to content
This repository has been archived by the owner on May 13, 2023. It is now read-only.

Commit

Permalink
build(docker): add mongo to docker compose (#33)
Browse files Browse the repository at this point in the history
  • Loading branch information
ooliver1 authored Oct 18, 2022
1 parent 13eed37 commit 6e55bf6
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!poetry*
!pyproject.toml
!.env
!ezar
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ __pycache__
.venv
.env
.vscode
mongo_data/
15 changes: 15 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 10 additions & 0 deletions mongo_init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
db.createUser({
user: "ezar",
pwd: "WhatAShame",
roles: [
{
role: "readWrite",
db: "eZaR",
},
],
});

0 comments on commit 6e55bf6

Please sign in to comment.