Skip to content
This repository has been archived by the owner on Jul 7, 2024. It is now read-only.

Commit

Permalink
add docker compose infra for local mongo, refactor command disabled c…
Browse files Browse the repository at this point in the history
…hecking (#41)

* fix: fixed more permission validation issues

* feat: added mongo+bot docker compose

---------

Co-authored-by: zleyyij <[email protected]>
  • Loading branch information
zleyyij and zleyyij authored Nov 9, 2023
1 parent 75a1f76 commit abb3771
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
33 changes: 33 additions & 0 deletions infrastructure/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# https://docs.docker.com/compose/networking/
version: "3.8"
services:
# the dockerfile to build turingbot is located at ../
turingbot:
container_name: turingbot
build: ../
# mount the config and secrets
volumes:
- type: bind
source: ../config.jsonc
target: /usr/src/turingbot/config.jsonc
- type: bind
source: ../secrets.jsonc
target: /usr/src/turingbot/secrets.jsonc

restart: unless-stopped
depends_on:
- mongo
# at some point, i would like to have it be possible for mongodb to be routed in a way that it's accessible when the bot is not running in the docker container, maybe a port fwd
mongo:
container_name: mongo
image: mongo
ports:
- "27017:27017"
volumes:
- mongo:/data/db
environment:
# change these in production
- MONGO_INITDB_ROOT_PASSWORD=root
- MONGO_INITDB_ROOT_USERNAME=root
volumes:
mongo:
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 3 additions & 1 deletion secrets.default.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
// Otherwise set it to mongodb://
"protocol": "mongodb://",
// the IP address or URL of your mongodb instance
"address": "mongodb.example.com",
// if using docker compose, set this to `mongo`
"address": "mongo",
// The name for the database collection the bot will use
"dbName": "turingbot",
// Authentication credentials
// docker compose default creds are `root`, and `root`, *do not use this in prod*
// If your server doesn't use authentication credentials, leave these empty: ""
"username": "YOUR_MONGO_USERNAME",
"password": "YOUR_MONGO_PASSWORD"
Expand Down

0 comments on commit abb3771

Please sign in to comment.