# Ubuntu 22.04: isolated-vm 7 (hooks custom code on Node.js 26) ships binaries that need # glibc >= 2.34 and the GCC 12 libstdc++, and cannot be compiled with focal's gcc 10. FROM phusion/baseimage:jammy-1.0.4 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,journey_engine,content ARG COUNTLY_CONFIG_API_MONGODB_HOST=localhost ARG COUNTLY_CONFIG_FRONTEND_MONGODB_HOST=localhost ARG DEBIAN_FRONTEND=noninteractive ARG TZ=Etc/UTC CMD ["/sbin/my_init"] ## Setup Countly ENV COUNTLY_CONTAINER="both" \ COUNTLY_DEFAULT_PLUGINS="${COUNTLY_PLUGINS}" \ COUNTLY_CONFIG_API_API_HOST="0.0.0.0" \ COUNTLY_CONFIG_FRONTEND_WEB_HOST="0.0.0.0" \ NODE_OPTIONS="--max-old-space-size=2048 --no-node-snapshot" EXPOSE 80 USER root WORKDIR /opt/countly COPY . . RUN sed -i 's|http://|https://|g' /etc/apt/sources.list && \ find /etc/apt/sources.list.d -name '*.list' -exec sed -i 's|http://|https://|g' {} + || true && \ echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries && \ useradd -r -M -U -d /opt/countly -s /bin/false countly && \ apt-get update && \ apt-get install -y \ # standard build-essential libkrb5-dev git wget sudo \ # nginx nginx \ # puppeteer libgbm-dev libgbm1 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 \ # push / nghttp2 gcc g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev \ libevent-dev libjansson-dev libjemalloc-dev cython3 python3-dev python-setuptools && \ # node wget -qO- https://deb.nodesource.com/setup_26.x | bash - && \ # data_migration (mongo clients) wget -qO - https://pgp.mongodb.com/server-9.asc | sudo apt-key add - && \ echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/9.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-9.0.list && \ apt-get update && \ apt-get install -y nodejs mongodb-mongosh mongodb-org-tools && \ \ # configs cp ./bin/config/nginx.server.conf /etc/nginx/sites-enabled/default && \ cp ./bin/config/nginx.conf /etc/nginx/nginx.conf && \ cp ./api/config.sample.js ./api/config.js && \ cp ./frontend/express/config.sample.js ./frontend/express/config.js && \ cp ./frontend/express/public/javascripts/countly/countly.config.sample.js ./frontend/express/public/javascripts/countly/countly.config.js && \ \ # npm dependencies ./bin/docker/modify.sh && \ HOME=/tmp npm install --unsafe-perm && \ ./bin/docker/preinstall.sh && \ \ # web sdk bash ./bin/scripts/detect.init.sh && \ countly update sdk-web && \ \ # services and such mkdir -p /etc/my_init.d && cp ./bin/docker/postinstall.sh /etc/my_init.d/ && \ mkdir /etc/service/nginx && \ mkdir /etc/service/countly-api && \ mkdir /etc/service/countly-dashboard && \ echo "" >> /etc/nginx/nginx.conf && \ echo "daemon off;" >> /etc/nginx/nginx.conf && \ cp ./bin/commands/docker/nginx.sh /etc/service/nginx/run && \ cp ./bin/commands/docker/countly-api.sh /etc/service/countly-api/run && \ cp ./bin/commands/docker/countly-dashboard.sh /etc/service/countly-dashboard/run && \ chown -R countly:countly /opt/countly && \ # cleanup npm remove -y --no-save mocha should supertest && \ apt-get remove -y build-essential libkrb5-dev wget \ gcc g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev libjemalloc-dev cython3 python3-dev python-setuptools && \ apt-get install -y 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/* /tmp/.??* /var/tmp/* /var/tmp/.??* ~/.npm ~/.cache && \ # temporary to remove npm bug message mkdir /.npm && chown -R countly:countly /.npm # USER 1001:0