summaryrefslogtreecommitdiffstats
path: root/03-manticore/Dockerfile
blob: 6a2051353430232fd6f5dade35740eae595fccaf (plain)
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
FROM kolab/base-nodejs:latest

MAINTAINER Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>

RUN npm --verbose install -g \
        grunt-cli \
        phantomjs && \
    rm -rf /root/.npm/

WORKDIR /var/www/
RUN git clone https://git.kolab.org/diffusion/M/manticore.git /var/www/manticore.git/

WORKDIR /var/www/manticore.git/
RUN npm --verbose install && \
    npm --verbose dedupe && \
    rm -rf /root/.npm/

RUN bower install --allow-root
RUN grunt build

RUN mv server/config/local.env.sample.js server/config/local.env.js
RUN sed -r -i \
    -e "s|DOMAIN:.*,$|DOMAIN: 'http://localhost:8080',|g" \
    -e "s|STORAGE:.*$|STORAGE: 'local'|g" \
    -e "/WEBDAV_/d" \
    -e "/LDAP_/d" \
    -e "/LOCODOC_/d" \
    server/config/local.env.js

RUN sed -r -i \
    -e 's|^(\s+)root:.*,$|\1root: "/var/www/manticore.git",|g' \
    server/config/environment/index.js

RUN chown nobody:nobody \
    /var/www/manticore.git/server/config/seed.js \
    /var/www/manticore.git/server/config/

RUN ln -s dist/public/ public

ADD /entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]

USER nobody

ENV NODE_PATH /usr/lib/node_modules:/var/www/manticore.git/node_modules
ENV NODE_ENV production

CMD [ "/bin/node", "/var/www/manticore.git/server/app.js" ]