forked from Countly/countly-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[docker] Updating builds to node 10 + various fixes
- Loading branch information
Showing
8 changed files
with
119 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,58 @@ | ||
FROM node:8.16-jessie | ||
FROM node:10.19-jessie | ||
|
||
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 | ||
# Enterprise Edition: | ||
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,concurrent_users,retention_segments,revenue,logger,systemlogs,populator,reports,crashes,push,block,restrict,users,geo,star-rating,slipping-away-users,compare,server-stats,dashboards,assistant,flows,dbviewer,cohorts,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,remote-config,formulas,ab-testing | ||
|
||
EXPOSE 3001 | ||
HEALTHCHECK --start-period=60s CMD curl --fail http://localhost:3001/o/ping || exit 1 | ||
|
||
USER root | ||
|
||
# Core dependencies | ||
## Tini | ||
ENV TINI_VERSION v0.18.0 | ||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini | ||
RUN chmod +x /tini | ||
|
||
ENTRYPOINT ["/tini", "-v", "--"] | ||
|
||
RUN apt-get update && apt-get -y install sendmail sqlite3 | ||
|
||
# Required by push plugin | ||
RUN git clone https://github.com/nghttp2/nghttp2.git /tmp/nghttp2 && \ | ||
cd /tmp/nghttp2 && \ | ||
git checkout tags/v1.30.0 && \ | ||
export CFLAGS="-g -O2 -fPIC" && export CPPFLAGS="-fPIC" && autoreconf -i && automake && autoconf && ./configure --disable-examples --disable-app && make && make install | ||
ENV COUNTLY_CONTAINER="api" \ | ||
COUNTLY_DEFAULT_PLUGINS="${COUNTLY_PLUGINS}" \ | ||
COUNTLY_CONFIG_API_API_HOST="0.0.0.0" \ | ||
TINI_VERSION="0.18.0" | ||
|
||
# Setup Countly | ||
ENV COUNTLY_CONTAINER="api" | ||
ENV COUNTLY_DEFAULT_PLUGINS="${COUNTLY_PLUGINS}" | ||
ENV COUNTLY_CONFIG_API_API_HOST="0.0.0.0" | ||
|
||
## The files | ||
RUN mkdir /opt/countly && chown 1001:0 /opt/countly | ||
USER 1001:0 | ||
WORKDIR /opt/countly | ||
COPY --chown=1001:0 . . | ||
HEALTHCHECK --start-period=60s CMD curl --fail http://localhost:3001/o/ping || exit 1 | ||
|
||
## API runtime dependencies | ||
RUN cp -n api/config.sample.js api/config.js && \ | ||
cp -n frontend/express/config.sample.js frontend/express/config.js && \ | ||
COPY . . | ||
|
||
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 && \ | ||
git clone https://github.com/nghttp2/nghttp2.git /tmp/nghttp2 --single-branch --branch=v1.30.0 --depth=1 && \ | ||
(cd /tmp/nghttp2; \ | ||
export CFLAGS="-g -O2 -fPIC" && export CPPFLAGS="-fPIC" && autoreconf -i && automake && autoconf && ./configure --disable-examples --disable-app && make && make install) && \ | ||
\ | ||
# 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 && \ | ||
HOME=/tmp npm install && \ | ||
./bin/docker/preinstall.sh | ||
|
||
USER root | ||
|
||
RUN ./bin/docker/modify.sh && \ | ||
chown -R 1001:0 /opt/countly && \ | ||
./bin/docker/preinstall.sh && \ | ||
bash /opt/countly/bin/scripts/detect.init.sh && \ | ||
\ | ||
# cleanup & chown | ||
npm remove -y mocha nyc should supertest && \ | ||
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/* | ||
apt-get -y install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ | ||
rm -rf /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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,57 @@ | ||
FROM node:8.16-jessie | ||
FROM node:10.19-jessie | ||
|
||
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 | ||
# Enterprise Edition: | ||
#ARG COUNTLY_PLUGINS=mobile,web,desktop,plugins,density,locale,browser,sources,views,drill,funnels,concurrent_users,retention_segments,revenue,logger,systemlogs,populator,reports,crashes,push,block,restrict,users,geo,star-rating,slipping-away-users,compare,server-stats,dashboards,assistant,flows,dbviewer,cohorts,crash_symbolication,crashes-jira,groups,white-labeling,alerts,times-of-day,compliance-hub,onboarding,remote-config,formulas,ab-testing | ||
|
||
# Core dependencies | ||
## Tini | ||
ENV TINI_VERSION v0.18.0 | ||
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini | ||
RUN chmod +x /tini | ||
|
||
ENTRYPOINT ["/tini", "-v", "--"] | ||
EXPOSE 6001 | ||
HEALTHCHECK --start-period=120s CMD curl --fail http://localhost:6001/ping || exit 1 | ||
|
||
RUN apt-get update && apt-get -y install sendmail && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
USER root | ||
|
||
# Setup Countly | ||
ENV COUNTLY_CONTAINER="frontend" | ||
ENV COUNTLY_DEFAULT_PLUGINS="${COUNTLY_PLUGINS}" | ||
ENV COUNTLY_CONFIG_FRONTEND_WEB_HOST="0.0.0.0" | ||
# 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" | ||
|
||
## The files | ||
RUN mkdir /opt/countly && chown 1001:0 /opt/countly | ||
USER 1001 | ||
WORKDIR /opt/countly | ||
COPY --chown=1001 . . | ||
HEALTHCHECK --start-period=120s CMD curl --fail http://localhost:6001/ping || exit 1 | ||
|
||
RUN 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 && \ | ||
COPY . . | ||
|
||
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 && \ | ||
./bin/docker/preinstall.sh | ||
|
||
USER root | ||
|
||
RUN ./bin/docker/modify.sh && \ | ||
chown -R 1001:0 /opt/countly && \ | ||
./bin/docker/preinstall.sh && \ | ||
bash /opt/countly/bin/scripts/detect.init.sh && \ | ||
apt-get remove -y git g++ gcc make automake autoconf libtool pkg-config unzip python && \ | ||
countly update sdk-web && \ | ||
\ | ||
# cleanup & chown | ||
npm remove -y mocha nyc should supertest && \ | ||
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/* | ||
apt-get -y install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils && \ | ||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ | ||
rm -rf /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", "--"] | ||
|
||
USER 1001 | ||
RUN countly update sdk-web | ||
CMD ["/opt/countly/bin/docker/cmd.sh"] | ||
CMD ["/opt/countly/bin/docker/cmd.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters