Spaces:
Sleeping
Sleeping
Commit
·
fb73eec
1
Parent(s):
0201626
Create Dockerfile
Browse files- Dockerfile +32 -0
Dockerfile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# from official image
|
| 2 |
+
FROM ubuntu:18.04
|
| 3 |
+
|
| 4 |
+
# key-value pairs
|
| 5 |
+
# allow more than one
|
| 6 |
+
#
|
| 7 |
+
LABEL version="1.0"
|
| 8 |
+
|
| 9 |
+
# install package
|
| 10 |
+
RUN apt-get update
|
| 11 |
+
RUN apt-get install -y curl sudo
|
| 12 |
+
RUN curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
|
| 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 |
+
# expose port 3000 for acessing the app
|
| 25 |
+
EXPOSE 3000
|
| 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"]
|