forked from synzen/MonitoRSS-Clone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (27 loc) · 832 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
FROM node:12-stretch AS build
RUN apt-get update && apt-get install -y \
g++ \
git \
make \
python \
&& mkdir -p /usr/src/node_modules \
&& chown -R node:node /usr/src
WORKDIR /usr/src
# Copy the package.json first before copying app
COPY package*.json ./
USER node
# If package.json hasn't changed, Docker uses same image layer, and npm install
# will be skipped since Docker assumes output is the same as before
RUN npm install
FROM node:12-alpine
RUN mkdir /app \
&& chown -R node:node /app
WORKDIR /app
COPY --from=build /usr/src .
# Copy the application from host machine directory argument of docker build
# to virtual machine
COPY --chown=node:node . .
USER node
ENV DRSS_BOT_TOKEN='drss_docker_token' \
DRSS_DATABASE_URI='mongodb://mongo:27017/rss'
CMD ["node", "bot.js"]