Update Dockerfile
Browse files- Dockerfile +12 -26
Dockerfile
CHANGED
@@ -1,32 +1,18 @@
|
|
1 |
-
|
2 |
-
FROM ubuntu:18.04
|
3 |
|
4 |
-
#
|
5 |
-
|
6 |
-
#
|
7 |
-
LABEL version="1.0"
|
8 |
|
9 |
-
#
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
RUN apt-get install -y nodejs
|
14 |
|
15 |
-
# set working directory to /app
|
16 |
-
WORKDIR /app
|
17 |
-
|
18 |
-
# copy index.js from current directory into the container at /app
|
19 |
-
COPY . /app
|
20 |
-
|
21 |
-
# install need packages specified in package.json
|
22 |
RUN npm install
|
|
|
|
|
23 |
|
24 |
-
#
|
|
|
25 |
EXPOSE 7860
|
26 |
-
|
27 |
-
# This allows Heroku bind its PORT the Apps port
|
28 |
-
# since Heroku needs to use its own PORT before the App can be made accessible to the World
|
29 |
-
EXPOSE $PORT
|
30 |
-
|
31 |
-
# run app when container launches
|
32 |
-
CMD ["node", "app.js"]
|
|
|
1 |
+
FROM node:18
|
|
|
2 |
|
3 |
+
# Create app directory
|
4 |
+
WORKDIR ./
|
|
|
|
|
5 |
|
6 |
+
# Install app dependencies
|
7 |
+
# A wildcard is used to ensure both package.json AND package-lock.json are copied
|
8 |
+
# where available (npm@5+)
|
9 |
+
COPY package*.json ./
|
|
|
10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
RUN npm install
|
12 |
+
# If you are building your code for production
|
13 |
+
# RUN npm ci --omit=dev
|
14 |
|
15 |
+
# Bundle app source
|
16 |
+
COPY . .
|
17 |
EXPOSE 7860
|
18 |
+
CMD [ "node", "app.js" ]
|
|
|
|
|
|
|
|
|
|
|
|