Skip to content

Commit a940d17

Browse files
committed
Update docker
1 parent 51c031e commit a940d17

6 files changed

+61
-6
lines changed

Dockerfile

+4
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,16 @@ RUN apt-get update && apt-get install -y sudo && \
3737
mkdir /etc/service/nginx && \
3838
mkdir /etc/service/countly-api && \
3939
mkdir /etc/service/countly-dashboard && \
40+
mkdir /etc/service/countly-ingestor && \
41+
mkdir /etc/service/countly-aggregator && \
4042
echo "" >> /etc/nginx/nginx.conf && \
4143
echo "daemon off;" >> /etc/nginx/nginx.conf && \
4244
\
4345
cp /opt/countly/bin/commands/docker/mongodb.sh /etc/service/mongodb/run && \
4446
cp /opt/countly/bin/commands/docker/nginx.sh /etc/service/nginx/run && \
4547
cp /opt/countly/bin/commands/docker/countly-api.sh /etc/service/countly-api/run && \
48+
cp /opt/countly/bin/commands/docker/countly-ingestor.sh /etc/service/countly-ingestor/run && \
49+
cp /opt/countly/bin/commands/docker/countly-aggregator.sh /etc/service/countly-aggregator/run && \
4650
cp /opt/countly/bin/commands/docker/countly-dashboard.sh /etc/service/countly-dashboard/run && \
4751
\
4852
chown mongodb /etc/service/mongodb/run && \

Dockerfile-core

+4
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,15 @@ RUN useradd -r -M -U -d /opt/countly -s /bin/false countly && \
6767
mkdir -p /etc/my_init.d && cp ./bin/docker/postinstall.sh /etc/my_init.d/ && \
6868
mkdir /etc/service/nginx && \
6969
mkdir /etc/service/countly-api && \
70+
mkdir /etc/service/countly-ingestor && \
71+
mkdir /etc/service/countly-aggregator && \
7072
mkdir /etc/service/countly-dashboard && \
7173
echo "" >> /etc/nginx/nginx.conf && \
7274
echo "daemon off;" >> /etc/nginx/nginx.conf && \
7375
cp ./bin/commands/docker/nginx.sh /etc/service/nginx/run && \
7476
cp ./bin/commands/docker/countly-api.sh /etc/service/countly-api/run && \
77+
cp ./bin/commands/docker/countly-ingestor.sh /etc/service/countly-ingestor/run && \
78+
cp ./bin/commands/docker/countly-aggregator.sh /etc/service/countly-aggregator/run && \
7579
cp ./bin/commands/docker/countly-dashboard.sh /etc/service/countly-dashboard/run && \
7680
chown -R countly:countly /opt/countly && \
7781
# cleanup
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
if [ "$COUNTLY_MONGO_INSIDE" == "1" ]
4+
then
5+
until mongo localhost --eval "db.stats()" | grep "collections"
6+
do
7+
echo
8+
echo "[api] waiting for MongoDB to allocate files ..."
9+
sleep 1
10+
done
11+
sleep 3
12+
echo "[api] MongoDB started"
13+
fi
14+
15+
exec /sbin/setuser countly /usr/bin/nodejs /opt/countly/api/aggregator.js
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
3+
if [ "$COUNTLY_MONGO_INSIDE" == "1" ]
4+
then
5+
until mongo localhost --eval "db.stats()" | grep "collections"
6+
do
7+
echo
8+
echo "[api] waiting for MongoDB to allocate files ..."
9+
sleep 1
10+
done
11+
sleep 3
12+
echo "[api] MongoDB started"
13+
fi
14+
15+
exec /sbin/setuser countly /usr/bin/nodejs /opt/countly/api/ingestor.js

bin/config/nginx.server.block.conf

+13-5
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,19 @@ server {
1212
if ($http_content_type = "text/ping") {
1313
return 404;
1414
}
15+
proxy_pass http://localhost:3010;
16+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
17+
proxy_set_header X-Real-IP $remote_addr;
18+
}
1519

16-
proxy_pass http://localhost:3001;
17-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
18-
proxy_set_header X-Real-IP $remote_addr;
19-
}
20+
location = /i/bulk {
21+
if ($http_content_type = "text/ping") {
22+
return 404;
23+
}
24+
proxy_pass http://localhost:3010;
25+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
26+
proxy_set_header X-Real-IP $remote_addr;
27+
}
2028

2129
# Unblocked paths on API service
2230
#
@@ -30,7 +38,7 @@ server {
3038
# /o/surveys/nps/widget
3139
# /i/campaign/click/*
3240

33-
location ~ (/i/bulk|/o/sdk|/o/actions|/o/feedback/multiple-widgets-by-id|/o/feedback/widget|/o/surveys/survey/widget|/o/surveys/nps/widget|/i/campaign/click/*) {
41+
location ~ (/o/sdk|/o/actions|/o/feedback/multiple-widgets-by-id|/o/feedback/widget|/o/surveys/survey/widget|/o/surveys/nps/widget|/i/campaign/click/*) {
3442
if ($http_content_type = "text/ping") {
3543
return 404;
3644
}

bin/config/nginx.server.ssl.conf

+10-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,16 @@ server {
6464
if ($http_content_type = "text/ping") {
6565
return 404;
6666
}
67-
proxy_pass http://localhost:3001;
67+
proxy_pass http://localhost:3010;
68+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
69+
proxy_set_header X-Real-IP $remote_addr;
70+
}
71+
72+
location = /i/bulk {
73+
if ($http_content_type = "text/ping") {
74+
return 404;
75+
}
76+
proxy_pass http://localhost:3010;
6877
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
6978
proxy_set_header X-Real-IP $remote_addr;
7079
}

0 commit comments

Comments
 (0)