Skip to content

Commit

Permalink
reset to latest branch state
Browse files Browse the repository at this point in the history
  • Loading branch information
chupapee committed Jul 22, 2023
1 parent f2c4a8e commit 1d211fc
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 22 deletions.
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
/.git
35 changes: 35 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# base image
FROM node:16.20.0-bullseye-slim

ARG APP_DIR=/usr/src/bots/social-media-bot

# container dir after creating
WORKDIR ${APP_DIR}

COPY package.json ${APP_DIR}
COPY yarn.lock ${APP_DIR}

RUN yarn install

# bundle app source code inside container
COPY . ${APP_DIR}

ENV NODE_ENV production

# We don't need the standalone Chromium
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

# Install Google Chrome Stable and fonts
# Note: this installs the necessary libs to make the browser work with Puppeteer.
RUN apt-get update && apt-get install gnupg wget -y && \
wget --quiet --output-document=- https://dl-ssl.google.com/linux/linux_signing_key.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/google-archive.gpg && \
sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \
apt-get update && \
apt-get install google-chrome-stable -y --no-install-recommends && \
rm -rf /var/lib/apt/lists/*


# RUN yarn install && yarn build &&
RUN yarn build

CMD [ "yarn", "process:start" ]
15 changes: 0 additions & 15 deletions ecosystem.config.js

This file was deleted.

9 changes: 2 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
"license": "MIT",
"scripts": {
"dev": "nodemon",
"build": "tsc && tsc-alias",
"build": "rm -rf dist && tsc",
"lint": "eslint src",
"lint:fix": "eslint src --fix",
"format": "prettier --write ./src/*",
"process:start": "yarn build && npx pm2 start ecosystem.config.js",
"process:stop": "npx pm2 stop social-media-downloader-bot",
"process:delete": "npx pm2 delete social-media-downloader-bot",
"process:restart": "yarn build && npx pm2 restart social-media-downloader-bot",
"update": "git pull && yarn process:restart"
"format": "prettier --write ./src/*"
},
"dependencies": {
"@types/node": "^20.1.7",
Expand Down

0 comments on commit 1d211fc

Please sign in to comment.