-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
36 lines (29 loc) · 865 Bytes
/
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
FROM alpine
# init envrionment
RUN \
echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/main' >> /etc/apk/repositories && \
echo 'http://dl-cdn.alpinelinux.org/alpine/v3.6/community' >> /etc/apk/repositories
RUN apk update
# install mongodb
RUN apk add --no-cache mongodb
RUN \
mkdir /data && \
mkdir /data/db
RUN apk add mongodb-tools
# install node.js
RUN apk add nodejs && apk add npm
# install app dependencies
RUN mkdir -p /app
WORKDIR /app
COPY package.json yarn.lock ./
RUN npm install -g yarn && yarn install
COPY . .
EXPOSE 3000
# set env variables
ENV DATABASE_URL=mongodb://localhost:27017/ir
ENV PORT=3000
# start up command
CMD \
mongod --bind_ip 0.0.0.0 --fork --logpath /var/log/mongod.log && \
mongorestore --uri mongodb://localhost:27017 ./backup/backup2-thousand-pages-of-github-repos-indexed && \
npm run start:web