Skip to content

Commit

Permalink
Add docker image and deployed to docker hub manually
Browse files Browse the repository at this point in the history
  • Loading branch information
Eomm committed Apr 17, 2018
1 parent 22adb71 commit 478b61e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 0 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM ubuntu:xenial

RUN apt-get update
RUN apt-get install -y ffmpeg curl
RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get install -y nodejs

WORKDIR /opt/app
COPY . .
RUN npm install --production

VOLUME "/var/convert/"

ENTRYPOINT [ "node", "entrypoint.js", "/var/convert/" ]
# CMD [ "node", "entrypoint.js" ]
19 changes: 19 additions & 0 deletions entrypoint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';

const FlacConverter = require('./lib/index');

const converter = new FlacConverter();

const inputDir = process.argv[2];

console.log(`Converting directory ${inputDir}`);
converter.convertDirectory(inputDir)
.then((files) => {
// All files are converted
console.log(`Converted ${files.length} flac`);
files.forEach(f => console.log(`Converted: ${f.fileConverted}`));
})
.catch((err) => {
// An error occured (some files could be converted)
console.log('Some errors occurs', err);
});
15 changes: 15 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,22 @@ This is an ultra-wide learning project, doesn't aim to be a [complete-ready-to-u

## Installation

**NPM package**

```
npm install ffmpeg-wrapper
```

This module need that [ffmpeg.org](https://www.ffmpeg.org/download.html) is installed on the local machine.


**Docker image**

```
docker pull eomm/ffmpeg-wrapper:1.0.0
```


### Usage

```
Expand All @@ -71,6 +80,12 @@ converter.convertDirectory('path-with-flac/')
```

With docker you can run simply a one-convert-action that convert a directory and then remove the container:

```
docker container run -v "/c/Users/user/convertDirectory/:/var/convert/" --rm eomm/ffmpeg-wrapper
```


## Contribute

Expand Down

0 comments on commit 478b61e

Please sign in to comment.