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",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"dev": "nodemon src/index.ts"
|
||||
"dev": "nodemon src/index.ts",
|
||||
"build": "tsc",
|
||||
"start": "node ."
|
||||
},
|
||||
"devDependencies": {
|
||||
"dotenv": "^17.4.2",
|
||||
|
||||
+2
-2
@@ -2,8 +2,8 @@
|
||||
// Visit https://aka.ms/tsconfig to read more about this file
|
||||
"compilerOptions": {
|
||||
// File Layout
|
||||
// "rootDir": "./src",
|
||||
// "outDir": "./dist",
|
||||
"rootDir": "./src",
|
||||
"outDir": "./dist",
|
||||
// Environment Settings
|
||||
// See also https://aka.ms/tsconfig/module
|
||||
"module": "nodenext",
|
||||
|
||||
Reference in New Issue
Block a user