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

Commit

Permalink
chore(guardoni): define docker image (#550)
Browse files Browse the repository at this point in the history
Co-authored-by: ascariandrea <[email protected]>
  • Loading branch information
chobeat and ascariandrea committed Jul 6, 2022
1 parent dff54dd commit b3b4dd8
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
__mocks__
.husky
**/build
**/docker
**/docker/electron-builder
**/coverage
**/node_modules
docker
!docker/guardoni/guardoni.config.json
31 changes: 31 additions & 0 deletions docker/guardoni/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM node:16-slim

RUN mkdir /guardoni
WORKDIR /guardoni
RUN apt-get update
RUN apt-get install -y python3 build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev

ADD ./ ./

RUN yarn install
RUN yarn tk:ext build
RUN yarn yt:ext build
RUN yarn guardoni build:cli
RUN yarn guardoni pkg
WORKDIR /guardoni/platforms/guardoni/dist/
RUN mv $(ls -1 guardoni-cli*-linux) guardoni-cli

FROM selenium/standalone-chrome:102.0
WORKDIR /guardoni

COPY --from=0 /guardoni/platforms/guardoni/dist/guardoni-cli guardoni-cli
COPY --from=0 "/guardoni/node_modules/@tktrex/extension/build" tktrex
COPY --from=0 "/guardoni/node_modules/@yttrex/extension/build" yttrex
COPY --from=0 /guardoni/docker/guardoni/guardoni.config.json .

USER root
RUN chmod -R 777 /guardoni/yttrex
RUN chmod -R 777 /guardoni/tktrex
USER seluser

ENTRYPOINT [ "/guardoni/guardoni-cli" ]
6 changes: 6 additions & 0 deletions docker/guardoni/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e

SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"
cd "$SCRIPT_DIR/../../"
docker build -f "docker/guardoni/Dockerfile" -t guardoni .
17 changes: 17 additions & 0 deletions docker/guardoni/guardoni.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"profileName": "dockerized-guardoni",
"headless": true,
"verbose": false,
"loadFor": 3000,
"yt": {
"name": "youtube",
"backend": "https://youtube.tracking.exposed/api",
"extensionDir": "/guardoni/yttrex"
},
"tk": {
"name": "tiktok",
"backend": "https://tiktok.tracking.exposed/api",
"extensionDir": "/guardoni/tktrex"
},
"chromePath": "/usr/bin/google-chrome"
}

0 comments on commit b3b4dd8

Please sign in to comment.