Skip to content

Commit 84d5774

Browse files
author
nonsensetwice
committed
bot initialization: welcome to spades 1.0.0
1 parent 44ae157 commit 84d5774

19 files changed

+3015
-0
lines changed

.dockerignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
**/.classpath
2+
**/.dockerignore
3+
**/.env
4+
**/.git
5+
**/.gitignore
6+
**/.project
7+
**/.settings
8+
**/.toolstarget
9+
**/.vs
10+
**/.vscode
11+
**/*.*proj.user
12+
**/*.dbmdl
13+
**/*.jfm
14+
**/charts
15+
**/docker-compose*
16+
**/compose*
17+
**/Dockerfile*
18+
**/node_modules
19+
**/npm-debug.log
20+
**/obj
21+
**/secrets.dev.yaml
22+
**/values.dev.yaml
23+
LICENSE
24+
README.md

.env.template

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
NODE_ENV=development
2+
APP_NAME=
3+
4+
# Discord application
5+
DISCORD_BOT_TOKEN=
6+
DISCORD_BOT_PUBLIC_KEY=
7+
DISCORD_BOT_APPLICATION_ID=
8+
DISCORD_BOT_ACTIVITY=
9+
10+
# MongoDB
11+
MONGODB_PREFIX=mongodb+srv
12+
MONGODB_USERNAME=
13+
MONGODB_PASS=
14+
MONGODB_CLUSTER=
15+
DB_NAME=
16+
17+
# Pino-Loki
18+
LOKI_HOST=
19+
LOKI_USERNAME=
20+
LOKI_PASSWORD=
21+
22+
# Sentry
23+
SENTRY_IO_DSN=

.eslintrc.json

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": "eslint:recommended",
7+
"parserOptions": {
8+
"ecmaVersion": "latest",
9+
"sourceType": "module"
10+
},
11+
"rules": {
12+
"indent": [
13+
"error",
14+
"tab"
15+
],
16+
"linebreak-style": [
17+
"error",
18+
"unix"
19+
],
20+
"quotes": [
21+
"error",
22+
"single"
23+
],
24+
"semi": [
25+
"error",
26+
"always"
27+
]
28+
}
29+
}

.vscode/launch.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Docker Node.js Launch",
5+
"type": "docker",
6+
"request": "launch",
7+
"preLaunchTask": "docker-run: debug",
8+
"platform": "node"
9+
}
10+
]
11+
}

.vscode/tasks.json

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"type": "docker-build",
6+
"label": "docker-build",
7+
"platform": "node",
8+
"dockerBuild": {
9+
"dockerfile": "${workspaceFolder}/Dockerfile",
10+
"context": "${workspaceFolder}",
11+
"pull": true
12+
}
13+
},
14+
{
15+
"type": "docker-run",
16+
"label": "docker-run: release",
17+
"dependsOn": [
18+
"docker-build"
19+
],
20+
"platform": "node"
21+
},
22+
{
23+
"type": "docker-run",
24+
"label": "docker-run: debug",
25+
"dependsOn": [
26+
"docker-build"
27+
],
28+
"dockerRun": {
29+
"env": {
30+
"DEBUG": "*",
31+
"NODE_ENV": "development"
32+
}
33+
},
34+
"node": {
35+
"enableDebugging": true
36+
}
37+
}
38+
]
39+
}

Dockerfile

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:lts-alpine
2+
ENV NODE_ENV=production
3+
WORKDIR /app
4+
COPY ["package.json", "package-lock.json*", "npm-shrinkwrap.json*", "./"]
5+
RUN npm install --production --silent && mv node_modules ../
6+
COPY . ./
7+
RUN chown -R node /app
8+
USER node
9+
CMD ["npm", "start"]

docker-compose.debug.yml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: '3.4'
2+
3+
services:
4+
spades:
5+
image: spades
6+
build:
7+
context: .
8+
dockerfile: ./Dockerfile
9+
environment:
10+
NODE_ENV: development
11+
ports:
12+
- 9229:9229
13+
command: ["node", "--inspect=0.0.0.0:9229", "src/app/app.js"]

docker-compose.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
version: '3.4'
2+
3+
services:
4+
bot:
5+
container_name: spades
6+
build:
7+
context: .
8+
dockerfile: ./Dockerfile
9+
environment:
10+
NODE_ENV: development
11+
APP_NAME: ${spades}
12+
13+
# Discord application
14+
DISCORD_BOT_TOKEN: ${DISCORD_BOT_TOKEN}
15+
DISCORD_BOT_PUBLIC_KEY: ${DISCORD_BOT_PUBLIC_KEY}
16+
DISCORD_BOT_APPLICATION_ID: ${DISCORD_BOT_APPLICATION_ID}
17+
DISCORD_BOT_ACTIVITY: ${DISCORD_BOT_ACTIVITY}
18+
19+
# MongoDB
20+
MONGODB_PREFIX: ${MONGODB_PREFIX}
21+
MONGODB_USERNAME: ${MONGODB_USERNAME}
22+
MONGODB_PASS: ${MONGODB_PASS}
23+
MONGODB_CLUSTER: ${MONGODB_CLUSTER}
24+
DB_NAME: ${DB_NAME}
25+
26+
# Pino-Loki
27+
LOKI_HOST: ${LOKI_HOST}
28+
LOKI_USERNAME: ${LOKI_USERNAME}
29+
LOKI_PASSWORD: ${LOKI_PASSWORD}
30+
31+
# Sentry
32+
SENTRY_IO_DSN: ${SENTRY_IO_DSN}

0 commit comments

Comments
 (0)