forked from fabric8-analytics/fabric8-analytics-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (34 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
FROM registry.centos.org/centos/centos:7
ENV LANG=en_US.UTF-8
RUN useradd -d /coreapi coreapi
# https://copr.fedorainfracloud.org/coprs/fche/pcp/
# https://copr.fedorainfracloud.org/coprs/msrb/mercator/
COPY hack/_copr_fche_pcp.repo hack/_copr_msrb-mercator.repo /etc/yum.repos.d/
# python3-pycurl is needed for Amazon SQS (boto lib), we need CentOS' rpm - installing it from pip results in NSS errors
RUN yum install -y epel-release &&\
yum --setopt=skip_missing_names_on_install=False install -y gcc patch git python36-pip python36-requests httpd httpd-devel python36-devel postgresql-devel redhat-rpm-config libxml2-devel libxslt-devel python36-pycurl pcp mercator openssl-devel &&\
yum clean all
COPY ./requirements.txt /coreapi/
RUN pushd /coreapi && \
python3.6 -m pip install -r requirements.txt && \
rm requirements.txt && \
popd
COPY ./coreapi-httpd.conf /etc/httpd/conf.d/
# Create & set pcp dirs
RUN mkdir -p /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp && \
chgrp -R root /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp && \
chmod -R g+rwX /etc/pcp /var/run/pcp /var/lib/pcp /var/log/pcp
COPY ./ /coreapi
RUN pushd /coreapi && \
python3.6 -m pip install --upgrade pip>=10.0.0 && pip3 install . &&\
popd
# Required by the solver task in worker to resolve dependencies from package.json
RUN npm install -g semver-ranger
COPY .git/ /tmp/.git
# date and hash of last commit
RUN cd /tmp/.git &&\
git show -s --format="COMMITTED_AT=%ai%nCOMMIT_HASH=%h%n" HEAD | tee /etc/coreapi-release &&\
rm -rf /tmp/.git/
COPY hack/coreapi-server.sh hack/server+pmcd.sh /usr/bin/
EXPOSE 44321
CMD ["/usr/bin/server+pmcd.sh"]