Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 37 additions & 15 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,37 @@
FROM node:alpine

RUN apk add libreoffice ffmpeg imagemagick tesseract-ocr


RUN apk add msttcorefonts-installer && \
update-ms-fonts && \
fc-cache -f

RUN apk add --update openjdk11
RUN java --version

# differs from production dockerfile
RUN apk add git

FROM node:alpine

RUN apk add libreoffice ffmpeg imagemagick tesseract-ocr


RUN apk add msttcorefonts-installer && \
update-ms-fonts && \
fc-cache -f

RUN apk add --update openjdk11
RUN java --version

RUN apk search -qe 'font-bitstream-*' | xargs apk add \
&& apk add \
font-arabic-misc \
font-daewoo-misc \
ttf-inconsolata \
font-ipa \
font-isas-misc \
font-jis-misc \
font-misc-misc \
font-noto \
font-noto-extra \
font-noto-thai \
font-noto-tibetan \
font-noto-cjk \
font-sony-misc \
terminus-font \
ttf-inconsolata \
ttf-dejavu \
ttf-font-awesome \
&& fc-cache -fv


# differs from production dockerfile
RUN apk add git

9 changes: 5 additions & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.git
node_modules
test
*.log
.devcontainer
.git
node_modules
test
*.log
72 changes: 48 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,48 @@
FROM node:alpine

RUN apk add libreoffice ffmpeg imagemagick tesseract-ocr


RUN apk add msttcorefonts-installer && \
update-ms-fonts && \
fc-cache -f

RUN apk add --update openjdk11
RUN java --version

WORKDIR /usr/src/app

COPY package.json .
COPY package-lock.json .

RUN npm install && npm audit fix --force

COPY . .

EXPOSE 3000

CMD [ "node", "index.js" ]
FROM node:alpine

RUN apk add libreoffice ffmpeg imagemagick tesseract-ocr


RUN apk add msttcorefonts-installer && \
update-ms-fonts && \
fc-cache -f

RUN apk add --update openjdk11
RUN java --version

RUN apk search -qe 'font-bitstream-*' | xargs apk add \
&& apk add \
font-arabic-misc \
font-daewoo-misc \
ttf-inconsolata \
font-ipa \
font-isas-misc \
font-jis-misc \
font-misc-misc \
font-noto \
font-noto-extra \
font-noto-thai \
font-noto-tibetan \
font-noto-cjk \
font-sony-misc \
terminus-font \
ttf-inconsolata \
ttf-dejavu \
ttf-font-awesome \
&& fc-cache -fv


WORKDIR /usr/src/app

COPY package.json .
COPY package-lock.json .

ENV NODE_ENV production

RUN npm install --omit=dev && npm audit fix --omit=dev --force

COPY . .

EXPOSE 3000

CMD [ "npm", "start" ]
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.7'

services:
versed:
build: .
ports:
- 3000:3000
restart: "on-failure"
environment:
- DEBUG=versed*
6 changes: 3 additions & 3 deletions test/test_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ import * as util from '../util.js';

describe('Util', function () {
describe('#mimetype()', function () {
it('should return type image of format png for "testing.png"', function () {
it('should return type "image" of format "png" for "testing.png"', function () {
const res = util.mimetype('testing.png');
assert.equal(res.type, 'image');
assert.equal(res.format, 'png');
});

it('should return type image of format png for "testing.docx"', function () {
it('should return type "application" of format "vnd.openxmlformats-officedocument.wordprocessingml.document" for "testing.docx"', function () {
const res = util.mimetype('testing.docx');
assert.equal(res.full, 'application/vnd.openxmlformats-officedocument.wordprocessingml.document');
assert.equal(res.type, 'application');
assert.equal(res.format, 'vnd.openxmlformats-officedocument.wordprocessingml.document');
});

it('should return type image of format png for "testing.mkv"', function () {
it('should return type "video" of format "x-matroska" for "testing.mkv"', function () {
const res = util.mimetype('testing.mkv');
assert.equal(res.full, 'video/x-matroska');
assert.equal(res.type, 'video');
Expand Down