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