-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
28 lines (22 loc) · 1.02 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
# src : https://nodejs.org/en/docs/guides/nodejs-docker-webapp/#creating-a-dockerfile
# Currently using Node LTS Hydrogen
FROM node:lts-hydrogen
# Create app directory
WORKDIR /usr/src/app
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
# Install npm@^9
# This should remove the outdated npm warning until v10
RUN ["npm", "install", "-g", "npm@9"]
# Install production dependencies
#RUN ["if"] ["[["] ["-n"] ["'\$dev' ]]"] ["&&"] ["[["] ["'\$dev'"] ["="] ["'1'"] ["]]"] [";"] ["then"] ["npm"] ["ci"] [";"] ["else"] ["npm"] ["ci"] ["--omit=dev"] [";"] ["fi"]
RUN ["npm", "ci", "--omit=dev"]
# Bundle app source
COPY . .
# Run the bot
# Use node for production
#CMD if [[ -n "\$dev" ]] && [[ "\$dev" = "1" ]] ; then npm run dev ; else node main.js ; fi
#CMD [ ["echo"] ["\"if"] ["[[ -n '\$dev' ]]"] ["&&"] ["[[ '\$dev' = '1' ]]"] [";"] ["then npm ci ;"] ["else npm ci --omit=dev ;"] ["fi\""] ["|"] ["bash"] ]
CMD [ "node", "main.js" ]