forked from Countly/countly-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile-centos-frontend
64 lines (54 loc) · 3.14 KB
/
Dockerfile-centos-frontend
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
FROM centos:7.8.2003
ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,enterpriseinfo,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,assistant,times-of-day,compliance-hub,video-intelligence-monetization,alerts,onboarding,consolidate
# Enterprise Edition:
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,retention_segments,flows,cohorts,surveys,remote-config,ab-testing,formulas,activity-map,concurrent_users,revenue,logger,systemlogs,populator,reports,crashes,push,geo,block,restrict,users,star-rating,slipping-away-users,compare,server-stats,assistant,dbviewer,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,active_users,performance-monitoring,config-transfer,consolidate,data-manager,hooks,dashboards
EXPOSE 6001
HEALTHCHECK --start-period=120s CMD curl --fail http://localhost:6001/ping || exit 1
USER root
# Core dependencies
## Tini
ENV COUNTLY_CONTAINER="frontend" \
COUNTLY_DEFAULT_PLUGINS="${COUNTLY_PLUGINS}" \
COUNTLY_CONFIG_FRONTEND_WEB_HOST="0.0.0.0" \
TINI_VERSION="0.18.0" \
PATH="/opt/rh/rh-nodejs10/root/usr/bin:${PATH}"
WORKDIR /opt/countly
COPY . .
RUN curl -s -L -o /tmp/tini.rpm "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.rpm" && \
rpm -i /tmp/tini.rpm && \
\
curl -sL https://rpm.nodesource.com/setup_14.x | bash - && \
yum -y install nodejs && \
ln -s /usr/bin/node /usr/bin/nodejs && \
\
yum -y install centos-release-scl && \
yum -y install openssl-devel devtoolset-7-gcc-c++ make git wget unzip make binutils autoconf automake makedepend libtool pkgconfig zlib-devel libxml2-devel python-setuptools && \
source /opt/rh/devtoolset-7/enable && \
\
# modify standard distribution
./bin/docker/modify.sh && \
\
# preinstall
cp -n ./frontend/express/public/javascripts/countly/countly.config.sample.js ./frontend/express/public/javascripts/countly/countly.config.js && \
cp -n ./frontend/express/config.sample.js ./frontend/express/config.js && \
cp -n ./api/config.sample.js ./api/config.js && \
HOME=/tmp npm install --unsafe-perm=true --allow-root && \
HOME=/tmp npm install argon2 --build-from-source --unsafe-perm=true --allow-root && \
./bin/docker/preinstall.sh && \
bash /opt/countly/bin/scripts/detect.init.sh && \
countly update sdk-web && \
\
# cleanup & chown
npm remove -y --no-save mocha nyc should supertest puppeteer && \
rm -rf /opt/app-root/src/.npm && \
yum remove -y git wget unzip gcc-c++ gcc centos-release-scl devtoolset-7-gcc-c++ devtoolset-7-gcc make automake autoconf makedepend zlib-devel libxml2-devel python-setuptools openssl-devel devtoolset-7-gcc devtoolset-7-libstdc++-devel python36-devel centos-release-scl devtoolset-7-gcc-c++ && \
yum clean all && \
rm -rf test /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* /var/log/* && \
chown -R 1001:0 /opt/countly && \
chmod -R g=u /opt/countly && \
\
bash ./bin/scripts/detect.init.sh && \
./bin/commands/countly.sh update sdk-web
USER 1001:0
ENTRYPOINT ["/usr/bin/tini", "-v", "--"]
CMD ["/opt/countly/bin/docker/cmd.sh"]