forked from ietf-tools/author-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
83 lines (69 loc) · 2.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
FROM ubuntu:jammy
LABEL maintainer="Kesara Rathnayake <kesara@staff.ietf.org>"
ENV DEBIAN_FRONTEND noninteractive
ENV PATH=$PATH:./node_modules/.bin
# Disable local file read for kramdown-rfc
ENV KRAMDOWN_SAFE=1
WORKDIR /usr/src/app
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && \
apt-get install -y \
software-properties-common \
gcc \
wget \
ruby \
python3.10 \
python3-pip \
libpango-1.0-0 \
wdiff \
rfcdiff \
npm \
gawk \
bison \
flex && \
rm -rf /var/lib/apt/lists/* /var/log/dpkg.log && \
apt-get autoremove -y && \
apt-get clean -y
# Install required fonts
RUN mkdir -p ~/.fonts/opentype && \
wget -q https://noto-website-2.storage.googleapis.com/pkgs/Noto-unhinted.zip && \
unzip -q Noto-unhinted.zip -d ~/.fonts/opentype/ && \
rm Noto-unhinted.zip && \
wget -q https://fonts.google.com/download?family=Roboto%20Mono -O roboto-mono.zip && \
unzip -q roboto-mono.zip -d ~/.fonts/opentype/ && \
rm roboto-mono.zip
# Install bap
RUN wget https://github.com/ietf-tools/bap/archive/refs/heads/master.zip && \
unzip -q master.zip -d /tmp/bap && \
cd /tmp/bap/bap-master/ && \
./configure && \
make && \
cp aex bap /bin && \
rm -rf /tmp/bap master.zip
# Install idnits
RUN wget https://github.com/ietf-tools/idnits/archive/refs/tags/2.17.1.zip && \
unzip -q 2.17.1.zip -d ~/idnits && \
cp ~/idnits/idnits-2.17.1/idnits /bin && \
chmod +x /bin/idnits && \
rm -rf ~/idnits/idnits-2.17.1/idnits idnit 2.17.1.zip
# Install mmark
RUN arch=$(arch | sed s/aarch64/arm64/ | sed s/x86_64/amd64/) && \
wget "https://github.com/mmarkdown/mmark/releases/download/v2.2.30/mmark_2.2.30_linux_$arch.tgz" && \
tar zxf mmark_*.tgz -C /bin/ && \
rm mmark_*.tgz
COPY Gemfile Gemfile.lock LICENSE README.md api.yml constraints.txt package-lock.json package.json requirements.txt serve.py .
COPY at ./at
# Install JavaScript dependencies
RUN npm install
# Install Python dependencies
RUN pip3 install -r requirements.txt -c constraints.txt waitress
# Install Ruby dependencies
RUN gem install bundler && bundle install
RUN mkdir -p tmp && \
echo "UPLOAD_DIR = '$PWD/tmp'" > at/config.py && \
echo "VERSION = '0.12.8'" >> at/config.py && \
echo "REQUIRE_AUTH = False" >> at/config.py && \
echo "DT_LATEST_DRAFT_URL = 'https://datatracker.ietf.org/doc/rfcdiff-latest-json'" >> at/config.py && \
echo "ALLOWED_DOMAINS = ['ietf.org', 'rfc-editor.org', 'github.com', 'githubusercontent.com', 'github.io', 'gitlab.com']" >> at/config.py
# host with waitress
CMD python3 serve.py