· 6 years ago · Dec 17, 2018, 11:46 AM
1FROM node:8.14.0-alpine
2
3#creating and switch to tmp
4WORKDIR /tmp/
5
6#copying the package and package-lock.json there
7COPY package*.json /tmp/
8
9RUN npm install
10#RUN npm update
11#RUN npm audit fix
12
13#when going into prod, switch to this forsenE
14#RUN npm install --only=production
15
16#trying to fix the retarded socket bug forsen
17#instead of --depth=9999 we could also pull the packet manually by adding
18#"ws": "^whatever" to the package.json and performing the following
19#RUN rm -rf /tmp/app/node_modules/tmi.js/node_modules/ws/* && cp -r /tmp/node_modules/ws/* /tmp/node_modules/tmi.js/node_modules/ws/
20
21
22#creating/switching to /opt/app
23WORKDIR /opt/app
24
25RUN cp -a /tmp/node_modules /opt/app && mkdir lidl_modules && mkdir lidl_core && rm -rf /tmp/*
26
27
28COPY *.js /opt/app/
29COPY lidl_modules/* lidl_modules/
30COPY lidl_core/* lidl_core/
31
32#environnement variable we need
33ENV BOT_USERNAME=lidler_bot OAUTH_TOKEN= ROOT_TWITCH_USERNAME= MONGO_DB_USER=root MONGO_DB_PASSORD=example MONGO_DB_HOST=mongo
34
35
36CMD ["node","app.js"]
37#CMD ["npm","start"]
38~