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

Commit

Permalink
feat: dockerise the bot (#756)
Browse files Browse the repository at this point in the history
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 18, 2022
1 parent 87b624d commit 817fafa
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 35 deletions.
7 changes: 7 additions & 0 deletions .dockerignore
@@ -0,0 +1,7 @@
node_modules/
.env
.idea/
dist/
.vscode/
src/listeners/debug.ts
yarn-error.log
16 changes: 16 additions & 0 deletions .github/workflows/build.yml
@@ -0,0 +1,16 @@
name: Build docker image
on:
push:
branches:
- "main"
pull_request:

jobs:
build:
name: Build docker image
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v3
- name: Build docker image
run: docker build . --file Dockerfile --tag hypixel-translators-bot:$(date +%s)
23 changes: 0 additions & 23 deletions .github/workflows/lintCompile.yml

This file was deleted.

22 changes: 22 additions & 0 deletions Dockerfile
@@ -0,0 +1,22 @@
FROM node:18
RUN apt-get update
# Install the dependencies for canvas
RUN apt-get install build-essential -y
# Install the dependencies for puppeteer
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
# Define working directory (we will automatically cd into it)
WORKDIR /app
# Copy everything from the current directory to the working directory (except the files in .dockerignore)
COPY . .
# Install dependencies
RUN yarn
# Lint
RUN yarn lint:ci
# Remove deps from canvas
RUN apt-get remove build-essential -y
# Remove deps from puppeteer
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
# Set NODE_ENV to production
ENV NODE_ENV=production
# Run the app
CMD ["yarn", "start"]
1 change: 0 additions & 1 deletion Procfile

This file was deleted.

5 changes: 5 additions & 0 deletions heroku.yml
@@ -0,0 +1,5 @@
build:
docker:
worker: Dockerfile
run:
worker: yarn start
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -30,10 +30,10 @@
"uuid": "^8.3.2"
},
"engines": {
"node": "16.x"
"node": "18.x"
},
"devDependencies": {
"@types/node": "^16.11.41",
"@types/node": "^18.0.0",
"@types/node-cron": "^3.0.1",
"@types/uuid": "^8.3.4",
"@typescript-eslint/eslint-plugin": "^5.28.0",
Expand Down
13 changes: 4 additions & 9 deletions yarn.lock
Expand Up @@ -174,15 +174,10 @@
resolved "https://registry.yarnpkg.com/@types/node-cron/-/node-cron-3.0.1.tgz#e01a874d4c2aa1a02ebc64cfd1cd8ebdbad7a996"
integrity sha512-BkMHHonDT8NJUE/pQ3kr5v2GLDKm5or9btLBoBx4F2MB2cuqYC748LYMDC55VlrLI5qZZv+Qgc3m4P3dBPcmeg==

"@types/node@*":
version "17.0.42"
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.42.tgz#d7e8f22700efc94d125103075c074396b5f41f9b"
integrity sha512-Q5BPGyGKcvQgAMbsr7qEGN/kIPN6zZecYYABeTDBizOsau+2NMdSVTar9UQw21A2+JyA2KRNDYaYrPB0Rpk2oQ==

"@types/node@^16.11.41":
version "16.11.41"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.41.tgz#88eb485b1bfdb4c224d878b7832239536aa2f813"
integrity sha512-mqoYK2TnVjdkGk8qXAVGc/x9nSaTpSrFaGFm43BUH3IdoBV0nta6hYaGmdOvIMlbHJbUEVen3gvwpwovAZKNdQ==
"@types/node@*", "@types/node@^18.0.0":
version "18.0.0"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.0.0.tgz#67c7b724e1bcdd7a8821ce0d5ee184d3b4dd525a"
integrity sha512-cHlGmko4gWLVI27cGJntjs/Sj8th9aYwplmZFwmmgYQQvL5NUsgVJG7OddLvNfLqYS31KFN0s3qlaD9qCaxACA==

"@types/uuid@^8.3.4":
version "8.3.4"
Expand Down

0 comments on commit 817fafa

Please sign in to comment.