-
Notifications
You must be signed in to change notification settings - Fork 973
/
Dockerfile-frontend
75 lines (64 loc) · 3.44 KB
/
Dockerfile-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
65
66
67
68
69
70
71
72
73
74
75
FROM node:hydrogen-bullseye-slim
ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,logger,systemlogs,populator,reports,crashes,push,star-rating,slipping-away-users,compare,server-stats,dbviewer,times-of-day,compliance-hub,alerts,onboarding,consolidate,remote-config,hooks,dashboards,sdk,data-manager,guides
# Countly Enterprise:
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,license,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,users,star-rating,slipping-away-users,compare,server-stats,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,heatmaps,sdk,guides
EXPOSE 6001
HEALTHCHECK --start-period=400s 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" \
NODE_OPTIONS="--max-old-space-size=2048" \
TINI_VERSION="0.18.0"
WORKDIR /opt/countly
COPY . .
# install required dependencies which slim image doesn't have
RUN apt-get update && \
apt-get install -y iputils-ping net-tools telnet apt-transport-https procps curl wget git python2 make gcc g++ unzip && \
ln -s /usr/bin/python2.7 /usr/bin/python
RUN apt-get update && \
apt-get upgrade -y && \
cd /usr/src && \
wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tar.xz && \
tar -xf Python-3.8.12.tar.xz && \
apt-get install -y build-essential sudo zlib1g-dev libssl1.1 libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev && \
cd Python-3.8.12 && \
./configure --enable-optimizations --enable-shared && \
make && \
make altinstall && \
ldconfig /usr/src/Python-3.8.12 && \
ln -s /usr/local/bin/python3.8 /usr/bin/python3
RUN curl -s -L -o /tmp/tini.deb "https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini_${TINI_VERSION}.deb" && \
dpkg -i /tmp/tini.deb && \
\
# modify standard distribution
apt-get update && apt-get install -y sqlite3 && \
./bin/docker/modify.sh && \
\
# preinstall
cp -n ./api/config.sample.js ./api/config.js && \
cp -n ./frontend/express/config.sample.js ./frontend/express/config.js && \
cp -n ./frontend/express/public/javascripts/countly/countly.config.sample.js ./frontend/express/public/javascripts/countly/countly.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 && \
apt-get remove -y git gcc g++ make automake autoconf libtool pkg-config unzip sqlite3 && \
apt-get autoremove -y && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
rm -rf test /tmp/* /tmp/.??* /var/tmp/* /var/tmp/.??* /var/log/* /root/.npm && \
\
# temporary to remove npm bug message
mkdir /.npm && chown -R 1001:0 /.npm && \
\
chown -R 1001:0 /opt/countly && \
chmod -R g=u /opt/countly
USER 1001:0
ENTRYPOINT ["/usr/bin/tini", "-v", "--"]
CMD ["/opt/countly/bin/docker/cmd.sh"]