Skip to content
This repository was archived by the owner on Nov 22, 2023. It is now read-only.

Commit 817fafa

Browse files
marzeqdependabot[bot]ImRodry
authored
feat: dockerise the bot (#756)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Rodry <[email protected]>
1 parent 87b624d commit 817fafa

File tree

8 files changed

+56
-35
lines changed

8 files changed

+56
-35
lines changed

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules/
2+
.env
3+
.idea/
4+
dist/
5+
.vscode/
6+
src/listeners/debug.ts
7+
yarn-error.log

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Build docker image
2+
on:
3+
push:
4+
branches:
5+
- "main"
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
name: Build docker image
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout Project
14+
uses: actions/checkout@v3
15+
- name: Build docker image
16+
run: docker build . --file Dockerfile --tag hypixel-translators-bot:$(date +%s)

.github/workflows/lintCompile.yml

Lines changed: 0 additions & 23 deletions
This file was deleted.

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
FROM node:18
2+
RUN apt-get update
3+
# Install the dependencies for canvas
4+
RUN apt-get install build-essential -y
5+
# Install the dependencies for puppeteer
6+
RUN apt-get install -y fonts-liberation gconf-service libayatana-appindicator-dev libasound2 libatk1.0-0 libcairo2 libcups2 libfontconfig1 libgbm-dev libgdk-pixbuf2.0-0 libgtk-3-0 libicu-dev libjpeg-dev libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libpng-dev libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 xdg-utils
7+
# Define working directory (we will automatically cd into it)
8+
WORKDIR /app
9+
# Copy everything from the current directory to the working directory (except the files in .dockerignore)
10+
COPY . .
11+
# Install dependencies
12+
RUN yarn
13+
# Lint
14+
RUN yarn lint:ci
15+
# Remove deps from canvas
16+
RUN apt-get remove build-essential -y
17+
# Remove deps from puppeteer
18+
RUN apt-get remove -y fonts-liberation gconf-service libayatana-appindicator-dev libasound2 libatk1.0-0 libcairo2 libcups2 libfontconfig1 libgbm-dev libgdk-pixbuf2.0-0 libgtk-3-0 libicu-dev libjpeg-dev libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libpng-dev libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 xdg-utils
19+
# Set NODE_ENV to production
20+
ENV NODE_ENV=production
21+
# Run the app
22+
CMD ["yarn", "start"]

Procfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

heroku.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
build:
2+
docker:
3+
worker: Dockerfile
4+
run:
5+
worker: yarn start

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@
3030
"uuid": "^8.3.2"
3131
},
3232
"engines": {
33-
"node": "16.x"
33+
"node": "18.x"
3434
},
3535
"devDependencies": {
36-
"@types/node": "^16.11.41",
36+
"@types/node": "^18.0.0",
3737
"@types/node-cron": "^3.0.1",
3838
"@types/uuid": "^8.3.4",
3939
"@typescript-eslint/eslint-plugin": "^5.28.0",

yarn.lock

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,10 @@
174174
resolved "https://registry.yarnpkg.com/@types/node-cron/-/node-cron-3.0.1.tgz#e01a874d4c2aa1a02ebc64cfd1cd8ebdbad7a996"
175175
integrity sha512-BkMHHonDT8NJUE/pQ3kr5v2GLDKm5or9btLBoBx4F2MB2cuqYC748LYMDC55VlrLI5qZZv+Qgc3m4P3dBPcmeg==
176176

177-
"@types/node@*":
178-
version "17.0.42"
179-
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.42.tgz#d7e8f22700efc94d125103075c074396b5f41f9b"
180-
integrity sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ==
181-
182-
"@types/node@^16.11.41":
183-
version "16.11.41"
184-
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.41.tgz#88eb485b1bfdb4c224d878b7832239536aa2f813"
185-
integrity sha512-mqoYK2TnVjdkGk8qXAVGc/x9nSaTpSrFaGFm43BUH3IdoBV0nta6hYaGmdOvIMlbHJbUEVen3gvwpwovAZKNdQ==
177+
"@types/node@*", "@types/node@^18.0.0":
178+
version "18.0.0"
179+
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a"
180+
integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==
186181

187182
"@types/uuid@^8.3.4":
188183
version "8.3.4"

0 commit comments

Comments
 (0)