forked from sdelements/lets-chat
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathDockerfile
48 lines (37 loc) · 1.31 KB
/
Dockerfile
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
FROM davidsblog/node-mongo:latest
MAINTAINER SD Elements
ENV PKG_JSON_URL=https://raw.githubusercontent.com/sdelements/lets-chat/master/package.json \
TAR_GZ_URL=https://github.com/sdelements/lets-chat/archive/master.tar.gz \
BUILD_DEPS='g++ gcc git make python' \
LCB_PLUGINS='lets-chat-ldap lets-chat-s3'
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
ADD $PKG_JSON_URL ./package.json
RUN set -x \
&& apt-get update \
&& apt-get install -y $BUILD_DEPS --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& npm install --production \
&& npm install $LCB_PLUGINS \
&& npm dedupe \
&& npm cache clean \
&& rm -rf /tmp/npm* \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false -o APT::AutoRemove::SuggestsImportant=false $BUILD_DEPS
ADD $TAR_GZ_URL ./master.tar.gz
RUN tar -xzvf master.tar.gz \
&& cp -a lets-chat-master/. . \
&& rm -rf lets-chat-master
RUN groupadd -r node \
&& useradd -r -g node node \
&& chown node:node uploads
ENV LCB_DATABASE_URI=mongodb://localhost/letschat \
LCB_HTTP_HOST=0.0.0.0 \
LCB_HTTP_PORT=8080 \
LCB_XMPP_ENABLE=true \
LCB_XMPP_PORT=5222
EXPOSE 8080 5222
VOLUME ["/usr/src/app/config"]
VOLUME ["/usr/src/app/uploads"]
ADD start.sh /usr/src/app/start.sh
RUN chmod +x /usr/src/app/start.sh
CMD "/usr/src/app/start.sh"