-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
64 lines (56 loc) · 1.64 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# This dockerfile is inspired from
# https://github.com/justinribeiro/dockerfiles/tree/master/chrome-headless
#
# Usage:
#
# docker run \
# -v $(pwd):/workdir \ # Map host's cwd with linkbak's output dir
# -u $(id -u):$(id -g) \ # Run command as current user
# --rm \ # Removes the container upon exit
# -ti \ # Run interactively, allocate a pseudo tty
# linkbak \
# /linkbak/src/linkbak/lnk2bak.py [OPTIONS] file_or_url
#
FROM python:3.7.0-slim-stretch
LABEL name="linkbak" \
maintainer="Aurélien Grosdidier <[email protected]>" \
version="0.1" \
description="Linkbak"
# Install:
# - dumb-init (to avoid zombie processes)
# - chromium
# - pandoc and texlive (required for PDF output)
# - curl/gnupg2/git (required by nodejs below)
RUN apt-get update && apt-get install -y \
dumb-init \
chromium \
pandoc \
texlive \
texlive-latex-recommended \
texlive-generic-recommended \
texlive-latex-extra \
lmodern \
curl \
gnupg2 \
git \
--no-install-recommends \
&& rm -rf /var/lib/apt/lists/*
# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs
# Install nodejs dependencies globally with npm
RUN npm -g install \
fs \
jsdom \
https://github.com/mozilla/readability
# Copy requirements.txt and install dependencies with pip
ENV LINKBAK /linkbak
COPY requirements.txt $LINKBAK/
RUN pip install -r $LINKBAK/requirements.txt
# Copy source
COPY . $LINKBAK
ENV PYTHONPATH $LINKBAK/src
# Set input/output directory
WORKDIR /workdir
# use dumb-init as the entry point
ENTRYPOINT ["/usr/bin/dumb-init", "--"]