forked from Countly/countly-server
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile-core
32 lines (24 loc) · 1.04 KB
/
Dockerfile-core
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
FROM phusion/baseimage:0.9.16
CMD ["/sbin/my_init"]
## Setup Countly
ENV INSIDE_DOCKER 1
ENV INSIDE_DOCKER_NOMONGO 1
COPY / /opt/countly
RUN useradd -r -M -U -d /opt/countly -s /bin/false countly && \
echo "countly ALL=(ALL) NOPASSWD: /usr/bin/sv restart countly-api countly-dashboard" >> /etc/sudoers.d/countly && \
/opt/countly/bin/countly.install.sh
# Change MongoDB folder permissions and add services folders
RUN 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
# Add services' run scripts
ADD ./bin/commands/docker/nginx.sh /etc/service/nginx/run
ADD ./bin/commands/docker/countly-api.sh /etc/service/countly-api/run
ADD ./bin/commands/docker/countly-dashboard.sh /etc/service/countly-dashboard/run
# Only root can change run scripts
RUN chown root /etc/service/nginx/run && \
chown -R countly:countly /opt/countly
EXPOSE 80
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*