forked from Medicean/VulApps
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
58 lines (48 loc) · 1.73 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
49
50
51
52
53
54
55
56
57
58
FROM ubuntu:14.04
MAINTAINER [email protected]
ENV LC_ALL C.UTF-8
ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
### APT source list
# RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
### Install Node.js
ARG NODE_URL=http://vulapps.xuanbo.cc/n/nodejs/nodejs/node-v4.3.2-linux-x64.tar.gz
RUN apt-get update \
&& apt-get install -y wget \
&& wget -qO /tmp/nodejs.tar.gz $NODE_URL \
&& mkdir -p /opt/node \
&& tar zxf /tmp/nodejs.tar.gz -C /opt/node --strip-components=1 \
&& ln -s /opt/node/bin/node /usr/bin/node \
&& ln -s /opt/node/bin/npm /usr/bin/npm \
&& rm -f /tmp/nodejs.tar.gz \
&& mkdir -p /htdocs
ARG MONGO_URL=http://vulapps.xuanbo.cc/m/mongodb/mongodb/mongodb-linux-x86_64-ubuntu1404-3.2.0.tgz
RUN apt-get update \
&& apt-get install -y wget \
&& wget -qO /tmp/mongodb.tgz $MONGO_URL \
&& mkdir -p /opt/mongodb \
&& tar zxf /tmp/mongodb.tgz -C /opt/mongodb --strip-components=1 \
&& mkdir -p /var/data \
&& rm -f /tmp/mongodb.tgz
ENV PATH /opt/node/bin:/opt/mongodb/bin:$PATH
VOLUME /var/data
ARG ANT_ZIP=http://vulapps.xuanbo.cc/tools/ant/ant-1.0.zip
RUN apt-get update \
&& apt-get install -y wget unzip \
&& wget -qO /tmp/ant.zip $ANT_ZIP \
&& unzip -d /htdocs /tmp/ant.zip \
&& rm /tmp/ant.zip
WORKDIR /tmp
COPY src/db.conf /htdocs/ant-master/database/db.conf
RUN set -x \
&& (nohup mongod -f /htdocs/ant-master/database/db.conf &) \
&& cd /htdocs/ant-master/database \
&& mongorestore \
&& rm -f /tmp/nohup.out
WORKDIR /htdocs/ant-master/web
RUN npm install
COPY src/start.sh /start.sh
RUN chmod +x /start.sh
EXPOSE 3000
ENTRYPOINT ["/start.sh"]
CMD ["tail", "-f", "/dev/null"]