Skip to content

Commit 736b9f4

Browse files
author
Thomas Einwaller
committed
added Dockerfile
1 parent 1d82363 commit 736b9f4

File tree

5 files changed

+108
-0
lines changed

5 files changed

+108
-0
lines changed

Dockerfile

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
FROM ubuntu:trusty
2+
3+
ENV DEBIAN_FRONTEND noninteractive
4+
5+
# REPOS
6+
RUN apt-get --yes update && \
7+
apt-get install -y software-properties-common && \
8+
add-apt-repository -y "deb http://archive.ubuntu.com/ubuntu $(lsb_release -sc) universe" && \
9+
add-apt-repository -y ppa:chris-lea/node.js && \
10+
add-apt-repository -y ppa:nginx/stable && \
11+
apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 && \
12+
echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | tee /etc/apt/sources.list.d/10gen.list && \
13+
mkdir -p /data/db && \
14+
apt-get --yes update && \
15+
apt-get install -y -q curl git wget mongodb-10gen nodejs supervisor imagemagick nginx build-essential
16+
17+
#SHIMS
18+
RUN dpkg-divert --local --rename --add /sbin/initctl && \
19+
rm /sbin/initctl && \
20+
ln -s /bin/true /sbin/initctl
21+
22+
ENV DEBIAN_FRONTEND dialog
23+
24+
## Setup Countly
25+
COPY / /opt/countly
26+
RUN mkdir -p /data/log && \
27+
cd /opt/countly/api ; npm install time && \
28+
rm /etc/nginx/sites-enabled/default && \
29+
cp /opt/countly/bin/config/nginx.server.conf /etc/nginx/sites-enabled/default && \
30+
cp /opt/countly/frontend/express/public/javascripts/countly/countly.config.sample.js /opt/countly/frontend/express/public/javascripts/countly/countly.config.js && \
31+
cp /opt/countly/api/config.sample.js /opt/countly/api/config.js && \
32+
cp /opt/countly/frontend/express/config.sample.js /opt/countly/frontend/express/config.js
33+
34+
ADD ./supervisor/supervisord.conf /etc/supervisor/supervisord.conf
35+
ADD ./supervisor/conf.d/nginx.conf /etc/supervisor/conf.d/nginx.conf
36+
ADD ./supervisor/conf.d/mongodb.conf /etc/supervisor/conf.d/mongodb.conf
37+
ADD ./supervisor/conf.d/countly.conf /etc/supervisor/conf.d/countly.conf
38+
39+
EXPOSE 80
40+
VOLUME ["/data"]
41+
CMD []
42+
ENTRYPOINT ["/usr/bin/supervisord"]

supervisor/conf.d/countly.conf

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[group:countly]
2+
programs=countly-dashboard, countly-api
3+
4+
[program:countly-dashboard]
5+
command=/usr/bin/node /opt/countly/frontend/express/app.js
6+
directory=/opt/countly/
7+
autorestart=true
8+
redirect_stderr=true
9+
stdout_logfile=/data/log/countly-dashboard.log
10+
stdout_logfile_maxbytes=500MB
11+
stdout_logfile_backups=50
12+
stdout_capture_maxbytes=1MB
13+
stdout_events_enabled=false
14+
loglevel=warn
15+
16+
[program:countly-api]
17+
command=/usr/bin/node /opt/countly/api/api.js
18+
directory=/opt/countly/
19+
autorestart=true
20+
autorestart=true
21+
redirect_stderr=true
22+
stdout_logfile=/data/log/countly-api.log
23+
stdout_logfile_maxbytes=500MB
24+
stdout_logfile_backups=50
25+
stdout_capture_maxbytes=1MB
26+
stdout_events_enabled=false
27+
loglevel=warn

supervisor/conf.d/mongodb.conf

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[program:mongodb]
2+
command=/usr/bin/mongod --noprealloc --smallfiles --dbpath /data/db
3+
autorestart=true
4+
redirect_stderr=true
5+
stdout_logfile=/data/log/mongodb.log
6+
stdout_logfile_maxbytes=500MB
7+
stdout_logfile_backups=50
8+
stdout_capture_maxbytes=1MB
9+
stdout_events_enabled=false
10+
loglevel=warn
11+

supervisor/conf.d/nginx.conf

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[program:nginx]
2+
command=/usr/sbin/nginx -g "daemon off;"
3+
autorestart=true
4+
redirect_stderr=true
5+
stdout_logfile=/data/log/nginx.log
6+
stdout_logfile_maxbytes=500MB
7+
stdout_logfile_backups=50
8+
stdout_capture_maxbytes=1MB
9+
stdout_events_enabled=false
10+
loglevel=warn

supervisor/supervisord.conf

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[unix_http_server]
2+
file=/var/run//supervisor.sock
3+
chmod=0700
4+
5+
[supervisord]
6+
logfile=/var/log/supervisor/supervisord.log
7+
pidfile=/var/run/supervisord.pid
8+
childlogdir=/var/log/supervisor
9+
nodaemon=true
10+
11+
[rpcinterface:supervisor]
12+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
13+
14+
[supervisorctl]
15+
serverurl=unix:///var/run//supervisor.sock
16+
17+
[include]
18+
files = /etc/supervisor/conf.d/*.conf

0 commit comments

Comments
 (0)