Skip to content

Commit

Permalink
internal: screw downloading packages in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hellos3b committed Sep 23, 2022
1 parent 579ec1c commit 48d85c1
Show file tree
Hide file tree
Showing 51 changed files with 230 additions and 226 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
### 🐛 Bug Fix
* define: disabled the old `!define` command from the legacy bot
* meetup: Reinitialize #meetups-directory messages if ids in db become corrupt
* internal: Require kick permissions for `/mod` commands
* mod: Require kick permissions for `/mod` commands

### 🏠 Internal
* Removed any module alias imports using `@sjbha` and switched to relative directory
* Switch to esbuild for building and use the bundle for docker file

# 2.2.8

### 🐛 Bug Fix
Expand Down
17 changes: 3 additions & 14 deletions bot/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,7 @@
FROM node:16 as builder

WORKDIR /app/bot
RUN npm install --global pnpm@6
COPY package.json pnpm-lock.yaml ./
RUN pnpm install
COPY ./dist/bot.js ./dist/bot.js
COPY package.json .


FROM builder as development
COPY tsconfig.json bsconfig.json ./
ENTRYPOINT pnpm rescript & pnpm dev


FROM builder as production
COPY tsconfig.json bsconfig.json ./
COPY src/ ./src/
RUN pnpm build
ENTRYPOINT pnpm start
ENTRYPOINT npm start
9 changes: 9 additions & 0 deletions bot/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"use strict";

// demo/some-js.bs.js
function hello() {
console.log("greetings");
}

// demo/some-intro.ts
console.log(hello());
8 changes: 5 additions & 3 deletions bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
"node": ">= 16"
},
"scripts": {
"start": "tsx src/Main.ts",
"start": "node dist/bot.js",
"dev:re": "rescript build -w",
"dev:ts": "ts-node-dev --transpile-only ./src/Main.ts",
"dev": "npm-run-all --parallel dev:re dev:ts",
"build": "rescript build",
"rescript": "rescript build -w",
"build": "npm run rescript & npm run bundle",
"bundle": "npx esbuild ./src/Main.ts --bundle --outfile=dist/bot.js --platform=node",
"rescript": "rescript build",
"test": "jest",
"test:watch": "jest --watch"
},
Expand Down Expand Up @@ -65,6 +66,7 @@
"@typescript-eslint/eslint-plugin": "^4.25.0",
"@typescript-eslint/parser": "^4.25.0",
"concurrently": "^7.3.0",
"esbuild": "^0.15.9",
"eslint": "^7.27.0",
"jest": "^27.3.1",
"mongodb-memory-server": "^8.0.2",
Expand Down
Loading

0 comments on commit 48d85c1

Please sign in to comment.