Update Dockerfile
Browse files- Dockerfile +19 -12
Dockerfile
CHANGED
|
@@ -1,19 +1,26 @@
|
|
| 1 |
#Use the official Node.js image.
|
| 2 |
FROM node
|
| 3 |
-
#
|
| 4 |
-
|
| 5 |
|
| 6 |
-
#
|
| 7 |
-
|
|
|
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
|
| 11 |
|
| 12 |
-
#
|
| 13 |
-
|
| 14 |
|
| 15 |
-
#
|
| 16 |
-
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
#Use the official Node.js image.
|
| 2 |
FROM node
|
| 3 |
+
# Switch to the "node" user
|
| 4 |
+
USER node
|
| 5 |
|
| 6 |
+
# Set home to the user's home directory
|
| 7 |
+
ENV HOME=/home/node \
|
| 8 |
+
PATH=/home/node/.local/bin:$PATH
|
| 9 |
|
| 10 |
+
# Set the working directory to the user's home directory
|
| 11 |
+
WORKDIR $HOME/app
|
| 12 |
|
| 13 |
+
# Moving file to user's home directory
|
| 14 |
+
ADD . $HOME/app
|
| 15 |
|
| 16 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 17 |
+
COPY --chown=node . $HOME/app
|
| 18 |
|
| 19 |
+
# Loading Dependencies
|
| 20 |
+
RUN npm install
|
| 21 |
+
|
| 22 |
+
# Expose application's default port
|
| 23 |
+
EXPOSE 7860
|
| 24 |
+
|
| 25 |
+
# Entry Point
|
| 26 |
+
ENTRYPOINT ["nodejs", "./index.js"]
|