-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b0e65a4
commit f7b3dcc
Showing
5 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
**/.dockerignore | ||
**/.env | ||
**/.git | ||
**/.github | ||
**/.gitignore | ||
**/.gitmodules | ||
**/.husky | ||
**/.project | ||
**/.settings | ||
**/.toolstarget | ||
**/.vs | ||
**/.vscode | ||
**/node_modules | ||
**/npm-debug.log | ||
**/build | ||
.eslintrc.yml | ||
.git-blame-ignore-revs | ||
.prettierignore | ||
.prettierrc.cjs | ||
docker | ||
indexes | ||
LICENSE.txt | ||
lint-staged.config.mjs | ||
Makefile | ||
package-lock.json | ||
package.json | ||
README.md | ||
run-persist.sh | ||
scripts | ||
SECURITY.md | ||
start.sh | ||
test | ||
tsconfig.json | ||
vitest.config.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
FROM node:current-alpine | ||
|
||
RUN --mount=type=bind,source=./package.json,target=package.json \ | ||
--mount=type=bind,source=./package-lock.json,target=package-lock.json \ | ||
--mount=type=cache,target=/root/.npm \ | ||
npm ci | ||
|
||
RUN adduser -s /bin/bash -D wheatley;echo 'wheatley:wheatley' | chpasswd | ||
|
||
USER wheatley | ||
|
||
WORKDIR /home/wheatley/bot | ||
|
||
COPY . . | ||
|
||
RUN npm run build | ||
|
||
CMD ["node", "build/src/main.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: wheatley | ||
|
||
services: | ||
bot: | ||
container_name: wheatley_bot | ||
image: TCCPP/wheatley | ||
build: | ||
context: ../ | ||
dockerfile: docker/bot/Dockerfile | ||
# pull_policy: build | ||
depends_on: | ||
- db | ||
# restart: always | ||
|
||
db: | ||
container_name: wheatley_db | ||
image: mongo:latest | ||
environment: | ||
- MONGO_INITDB_ROOT_USERNAME=admin | ||
- MONGO_INITDB_ROOT_PASSWORD=password | ||
- MONGO_INITDB_DATABASE=wheatley | ||
volumes: | ||
- ./db/mongo-init.js:/docker-entrypoint-initdb.d/mongo-init.js:ro | ||
- ./db/mongod.conf:/etc/mongod.conf:ro | ||
- wheatley_data:/data/db | ||
# expose: | ||
# - 27017 | ||
ports: | ||
- 127.0.0.1:27017:27017 | ||
# restart: always | ||
|
||
volumes: | ||
wheatley_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
|
||
// https://stackoverflow.com/a/68253550 | ||
db = db.getSiblingDB('admin'); | ||
db.auth("admin", "password"); | ||
db = db.getSiblingDB('wheatley'); | ||
db.createUser({user:'wheatley', pwd: 'wheatley', roles:[{db:'wheatley', role:'readWrite'}]}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
net: | ||
port: 27017 | ||
bindIp: 0.0.0.0 | ||
security: | ||
authorization: enabled |