mirror of
https://github.com/chenasraf/venom.git
synced 2026-05-17 17:28:08 +00:00
build: add db credentials to docker
This commit is contained in:
@@ -11,7 +11,7 @@ export DISCORD_APP_ID=
|
||||
export DISCORD_PUBLIC_KEY=
|
||||
export DISCORD_TOKEN=
|
||||
|
||||
# mongodb URI, e.g. "mongodb://localhost:27017"
|
||||
# mongodb URI, e.g. "mongodb://localhost:27017" or "mongodb://<username>:<password>@<host>:<port>"
|
||||
export MONGODB_URI=mongodb://localhost:27017
|
||||
|
||||
#################################################################################
|
||||
@@ -23,5 +23,9 @@ export APP_ROOT=
|
||||
# where the DB data is saved - absolute path, or relative to APP_ROOT
|
||||
export DB_PATH=data
|
||||
|
||||
# mongo db credentials for docker setup
|
||||
export DB_USER=
|
||||
export DB_PASS=
|
||||
|
||||
# logging
|
||||
export LOG_LEVEL=debug
|
||||
|
||||
@@ -9,6 +9,8 @@ WorkingDirectory={{appRoot}}
|
||||
ExecStart=/usr/bin/docker run --name venom-db \
|
||||
--volume {{dbPath}}/db:/data/db \
|
||||
--volume {{dbPath}}/configdb:/data/configdb \
|
||||
-e MONGO_INITDB_ROOT_USERNAME={{dbUser}} \
|
||||
-e MONGO_INITDB_ROOT_PASSWORD={{dbPass}} \
|
||||
-p 27017:27017 \
|
||||
mongo:latest
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ module.exports = {
|
||||
data: {
|
||||
appRoot: process.env.APP_ROOT,
|
||||
dbPath: path.resolve(process.env.APP_ROOT ?? process.cwd(), process.env.DB_PATH),
|
||||
dbUser: process.env.DB_USER,
|
||||
dbPass: process.env.DB_PASS,
|
||||
},
|
||||
name: '-',
|
||||
},
|
||||
|
||||
@@ -83,6 +83,8 @@ export async function trainMegahal(message: Discord.Message, replyChance: number
|
||||
totalMsgCount = 0
|
||||
}
|
||||
|
||||
logger.debug('Total unsaved messages:', totalMsgCount)
|
||||
|
||||
const response = megahal.reply(input)
|
||||
|
||||
if (Math.random() < replyChance && !isMuted()) {
|
||||
|
||||
Reference in New Issue
Block a user