forked from fabric8-analytics/fabric8-analytics-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
56 lines (41 loc) · 2.16 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
FROM registry.centos.org/centos/centos:7
ENV LANG=en_US.UTF-8 \
F8A_WORKER_VERSION=58d3025 \
F8A_AUTH_VERSION=5211e23 \
F8A_UTILS=3bca34e
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
RUN pip3 install git+https://github.com/fabric8-analytics/fabric8-analytics-worker.git@${F8A_WORKER_VERSION}
RUN pip3 install git+https://github.com/fabric8-analytics/fabric8-analytics-auth.git@${F8A_AUTH_VERSION}
RUN pip3 install git+https://github.com/fabric8-analytics/fabric8-analytics-utils.git@${F8A_UTILS}
RUN pip3 install git+https://github.com/fabric8-analytics/fabric8-analytics-version-comparator.git#egg=f8a_version_comparator
# 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"]