Skip to content

Commit

Permalink
Merge pull request #105 from EdJoPaTo/dockerfile
Browse files Browse the repository at this point in the history
Improve Dockerfile and provide some usage information
  • Loading branch information
jibon57 authored Oct 29, 2021
2 parents c2730db + d797046 commit 410edb1
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 22 deletions.
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.*ignore
.git
*.md
Dockerfile
41 changes: 19 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,22 @@
#Download base image debian
FROM node
FROM docker.io/library/node:14-bullseye

# Create app directory
WORKDIR /root
# LABEL about the custom image
LABEL maintainer="[email protected]"
LABEL version="0.1"
LABEL description="This is custom Docker Image for"

#Update Software Repository
RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app
#RUN apt-get -y curl
RUN curl -sS -o - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add
RUN echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" > /etc/apt/sources.list.d/google-chrome.list
RUN apt-get -y update
RUN apt-get -y install google-chrome-stable
RUN apt-get -y install software-properties-common
RUN add-apt-repository ppa:jonathonf/ffmpeg-4
#RUN apt-get -y update
RUN apt-get -y install ffmpeg
RUN apt -y install xvfb
RUN git clone https://github.com/jibon57/bbb-recorder
RUN cd bbb-recorder && npm install --ignore-scripts
WORKDIR /root/bbb-recorder
RUN apt-get -y update \
&& apt-get upgrade -y \
&& apt-get install -y \
ffmpeg \
google-chrome-stable \
xvfb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/* /var/log/*

RUN node --version && npm --version

WORKDIR /app
VOLUME /output
RUN echo "copyToPath=/output" > .env

COPY package.json ./
RUN npm install --ignore-scripts
COPY . ./
30 changes: 30 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,36 @@ npm install --ignore-scripts
cp .env.example .env
```

### Usage via container

Build the container once.

```bash
git clone https://github.com/jibon57/bbb-recorder
cd bbb-recorder
docker build -t bbb-recorder .
```

Then prefix the docker run command before the following examples.

```bash
docker run --detach -v ~/local-output-dir:/output bbb-recorder
```

In this case we specify `--detach` which means the container will run in background until it finishes.

For the [recording export](#recording-export) example this would be:

```bash
docker run --detach -v ~/local-output-dir:/output bbb-recorder node export.js "https://BBB_HOST/playback/presentation/2.0/playback.html?meetingId=MEETING_ID" meeting.webm 10 true
```

You can simplify this task with an alias:
```bash
alias bbb='docker run --detach -v ~/local-output-dir:/output bbb-recorder node export.js'
bbb "https://BBB_HOST/playback/presentation/2.0/playback.html?meetingId=MEETING_ID" meeting.webm 10 true
```

### Recording export

```sh
Expand Down

0 comments on commit 410edb1

Please sign in to comment.