Add Docker components
This commit is contained in:
@@ -0,0 +1,10 @@
|
|||||||
|
node_modules
|
||||||
|
npm-debug.log
|
||||||
|
Dockerfile
|
||||||
|
.dockerignore
|
||||||
|
.git
|
||||||
|
.gitignore
|
||||||
|
docker-compose.yml
|
||||||
|
.env
|
||||||
|
LICENSE
|
||||||
|
readme.md
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
FROM node:22-alpine AS builder
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
FROM node:22-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
RUN npm ci --omit=dev
|
||||||
|
|
||||||
|
COPY --from=builder /app .
|
||||||
|
|
||||||
|
CMD ["node", "dist/index.js"]
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
serivces:
|
||||||
|
discord-bot:
|
||||||
|
build: .
|
||||||
|
container_name: protector_bot
|
||||||
|
restart: unless-stopped
|
||||||
|
tty: true
|
||||||
|
environment:
|
||||||
|
- TOKEN=${TOKEN}
|
||||||
+3
-1
@@ -7,7 +7,9 @@
|
|||||||
"type": "commonjs",
|
"type": "commonjs",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nodemon src/index.ts"
|
"dev": "nodemon src/index.ts",
|
||||||
|
"build": "tsc",
|
||||||
|
"start": "node ."
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"dotenv": "^17.4.2",
|
"dotenv": "^17.4.2",
|
||||||
|
|||||||
+2
-2
@@ -2,8 +2,8 @@
|
|||||||
// Visit https://aka.ms/tsconfig to read more about this file
|
// Visit https://aka.ms/tsconfig to read more about this file
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
// File Layout
|
// File Layout
|
||||||
// "rootDir": "./src",
|
"rootDir": "./src",
|
||||||
// "outDir": "./dist",
|
"outDir": "./dist",
|
||||||
// Environment Settings
|
// Environment Settings
|
||||||
// See also https://aka.ms/tsconfig/module
|
// See also https://aka.ms/tsconfig/module
|
||||||
"module": "nodenext",
|
"module": "nodenext",
|
||||||
|
|||||||
Reference in New Issue
Block a user