Add Docker components

This commit is contained in:
Alexander Harding
2026-06-30 21:13:25 -04:00
parent a5f534d8e1
commit 8e531708b2
5 changed files with 41 additions and 3 deletions
+10
View File
@@ -0,0 +1,10 @@
node_modules
npm-debug.log
Dockerfile
.dockerignore
.git
.gitignore
docker-compose.yml
.env
LICENSE
readme.md
+18
View File
@@ -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"]
+8
View File
@@ -0,0 +1,8 @@
serivces:
discord-bot:
build: .
container_name: protector_bot
restart: unless-stopped
tty: true
environment:
- TOKEN=${TOKEN}
+3 -1
View File
@@ -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
View File
@@ -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",