-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
66 lines (51 loc) · 2.68 KB
/
Dockerfile
File metadata and controls
66 lines (51 loc) · 2.68 KB
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
# FROM cern/cc7-base:latest
FROM gitlab-registry.cern.ch/lhcb-docker/os-base/centos7-devel:latest
RUN yum install -y gcc-c++ make git which zlib-devel ncurses-devel
RUN curl -sL https://rpm.nodesource.com/setup_10.x | bash -
RUN yum install -y nodejs
RUN wget https://github.com/andreasfertig/cppinsights/releases/download/continuous/insights-ubuntu-14.04.tar.gz \
&& tar -xzf insights-ubuntu-14.04.tar.gz \
&& mv insights /usr/bin/ \
&& rm insights-ubuntu-14.04.tar.gz
# FIXME change pseyfert->compilerexplorer
RUN useradd compilerexplorer \
&& mkdir -p /home/compilerexplorer \
&& mkdir -p /home/pseyfert/.local/bin \
&& chown -R compilerexplorer:compilerexplorer /home/pseyfert
ADD --chown=compilerexplorer:compilerexplorer insights /home/pseyfert/.local/bin/
# get clang headers for cppinsights
# RUN mkdir -p /usr/lib/clang \
# && ln -s /cvmfs/lhcb.cern.ch/lib/lcg/releases/clang/8.0.0-ed577/x86_64-centos7/lib/clang/8.0.0 /usr/lib/clang/8.0.1
RUN mkdir -p /usr/lib/llvm-9/lib/clang/ \
&& ln -s /cvmfs/lhcb.cern.ch/lib/lcg/releases/clang/8.0.0-ed577/x86_64-centos7/lib/clang/8.0.0 /usr/lib/llvm-9/lib/clang/9.0.1
# will be needed by npm at runtime
RUN mkdir -p /tmp
ENV HOME /tmp
EXPOSE 10240
# automatically unpacks
ADD --chown=compilerexplorer:compilerexplorer iwyu.tar.gz /home/pseyfert
RUN chown -R compilerexplorer:compilerexplorer /home/pseyfert
# invalidate cache whenever compiler-explorer config changes (78479 is compiler-explorer.git)
ADD https://gitlab.cern.ch/api/v4/projects/78479 config_repo
RUN git clone https://:@gitlab.cern.ch:8443/pseyfert/compiler-explorer.git --depth=1 -b production_since-2019-11-14 \
&& cd compiler-explorer \
&& git config --global user.email "novalid@e.mail" \
&& git config --global user.name "docker-build" \
&& git fetch origin --depth=2 dateprint \
&& git cherry-pick 66e8e8336 \
&& cd .. \
&& mv /compiler-explorer /home/compilerexplorer/compiler-explorer \
&& cd /home/compilerexplorer/compiler-explorer \
&& make node_modules \
&& make dist \
&& rm -rf /home/compilerexplorer/compiler-explorer/.git \
&& chown -R compilerexplorer:compilerexplorer /home/compilerexplorer \
&& chmod -R 777 /home/compilerexplorer
# get security updates and such after cache invalidation, expected to be smaller than full yum install
RUN yum update -y
# for picking up the c++.pseyfert-ce.properties file
ENV EXTRA_ARGS -env=pseyfert-ce
ENV NODE_ENV production
USER compilerexplorer
WORKDIR /home/compilerexplorer/compiler-explorer
CMD ["/home/compilerexplorer/compiler-explorer/node_modules/.bin/supervisor", "--exec", "/usr/bin/node", "--", "./app.js", "-env=pseyfert-ce", "--static", "out/dist", "--dist"]