Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mongodb #45

Merged
merged 11 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ CLIENT_ID =
# invite link:
# https://discord.com/api/oauth2/authorize?CLIENT_ID=<clientId>&permissions=0&scope=bot%20applications.commands
SERVER_ID =
# Mongo configuration
MONGO_URI=
MONGO_PORT=
MONGO_USERNAME=
MONGO_PASSWORD=
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
---
name: Custom issue template
about: Describe this issue template's purpose here.
name: Question
about: I have a question about the bots functionality.
title: ''
labels: discussion, question
assignees: ''

---

**My Question is:*
\*_My Question is:_
Your Question about BingusBoingus.

**What I've tried so far**
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ node_modules/

tsconfig.tsbuildinfo
tsconfig.build.tsbuildinfo
bingusboingus.code-workspace
bingusboingus.code-workspace
.vscode/settings.*
28 changes: 28 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,31 @@ services:
ports:
- 3000:3000
restart: unless-stopped

mongo:
image: mongo:6.0.3
hostname: mongo
volumes:
- ./infra/mongo:/db/data:rw
- ./infra/mongo/mongo.conf:/etc/mongo/mongo.conf:ro
- ./infra/mongo/init.js:/docker-entrypoint-initdb.d/init.js:ro
env_file:
- ./infra/mongo/.env
command:
- --config
- /etc/mongo/mongo.conf
ports:
- 27017:27017
healthcheck:
test:
[
'CMD',
'sh',
'-c',
'echo ''db.runCommand("ping").ok'' | mongosh localhost:27017 --quiet',
]
interval: 10s
timeout: 10s
retries: 5
start_period: 40s
restart: unless-stopped
5 changes: 5 additions & 0 deletions infra/mongo/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
MONGO_INITDB_ROOT_USERNAME=
MONGO_INITDB_ROOT_PASSWORD=
MONGO_USER=
MONGO_PASSWORD=
MONGO_INITDB_DATABASE=
5 changes: 5 additions & 0 deletions infra/mongo/init.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
db.createUser({
user: _getEnv('MONGO_USER'),
pwd: _getEnv('MONGO_PASSWORD'),
roles: ['readWrite', 'dbAdmin'],
});
42 changes: 42 additions & 0 deletions infra/mongo/mongo.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# mongod.conf

# for documentation of all options, see:
# http://docs.mongodb.org/manual/reference/configuration-options/

# Where and how to store data.
# storage:
# dbPath: /var/lib/mongodb
# journal:
# enabled: true
# engine:
# wiredTiger:

# where to write logging data.
systemLog:
destination: file
logAppend: true
path: /var/log/mongodb/mongod.log

# network interfaces
net:
port: 27017
bindIp: 0.0.0.0


# how the process runs
processManagement:
timeZoneInfo: /usr/share/zoneinfo

#security:

#operationProfiling:

#replication:

#sharding:

## Enterprise-Only Options:

#auditLog:

#snmp:
Loading
Loading