-
Notifications
You must be signed in to change notification settings - Fork 137
/
Dockerfile
79 lines (61 loc) · 1.91 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
FROM debian:bookworm
ARG GIT_REPO_URL
ARG PROJECT
RUN \
: "${GIT_REPO_URL:?set GIT_REPO_URL to the repo git url}"
RUN \
: "${PROJECT:?set PROJECT to set the project name}"
RUN \
echo "repo url to index: ${GIT_REPO_URL}"
RUN \
apt-get update && \
apt-get --no-install-recommends -y install \
python3 \
python3-pip \
python3-falcon \
python3-jinja2 \
python3-bsddb3 \
python3-pytest \
python3-pygments- \
pipx \
perl \
git \
apache2 \
libapache2-mod-wsgi-py3 \
libjansson4 \
libyaml-0-2 \
wget
RUN \
wget https://bootlin.com/pub/elixir/universal-ctags_0+git20200526-0ubuntu1_amd64.deb
RUN \
dpkg -i universal-ctags_0+git20200526-0ubuntu1_amd64.deb
RUN \
wget https://bootlin.com/pub/elixir/Pygments-2.6.1.elixir-py3-none-any.whl
RUN \
pip3 install ./Pygments-2.6.1.elixir-py3-none-any.whl --break-system-packages
RUN \
git config --global user.email 'elixir@dummy.com' && \
git config --global user.name 'elixir'
RUN \
git clone https://github.com/bootlin/elixir.git /usr/local/elixir/
RUN \
mkdir -p /srv/elixir-data/ && \
mkdir -p /srv/elixir-data/$PROJECT/repo && \
mkdir -p /srv/elixir-data/$PROJECT/data && \
git clone --bare "${GIT_REPO_URL}" /srv/elixir-data/$PROJECT/repo/ && \
git config --global --add safe.directory /srv/elixir-data/$PROJECT/repo
ENV LXR_REPO_DIR /srv/elixir-data/$PROJECT/repo
ENV LXR_DATA_DIR /srv/elixir-data/$PROJECT/data
RUN \
cd /usr/local/elixir/ && \
./script.sh list-tags && \
python3 -u ./update.py && \
chown -R www-data:www-data /srv/elixir-data/$PROJECT/repo
# apache elixir config, see elixir README
# make apache less stricter about cgitb spam headers
COPY ./000-default.conf /etc/apache2/sites-available/000-default.conf
RUN \
echo -e "\nHttpProtocolOptions Unsafe" >> /etc/apache2/apache.conf && \
a2enmod cgi rewrite
EXPOSE 80
ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"]