Spaces:
Sleeping
Sleeping
Initial Draft
Browse files- Dockerfile +30 -0
Dockerfile
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Node base image
|
| 2 |
+
FROM node:16
|
| 3 |
+
|
| 4 |
+
# Set up a new user named "user" with user ID 1000
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
+
|
| 7 |
+
# Switch to the "user" user
|
| 8 |
+
USER user
|
| 9 |
+
|
| 10 |
+
# Set home to the user's home directory
|
| 11 |
+
ENV HOME=/home/user \
|
| 12 |
+
PATH=/home/user/.local/bin:$PATH
|
| 13 |
+
|
| 14 |
+
# Set the working directory to the user's home directory
|
| 15 |
+
WORKDIR $HOME/app
|
| 16 |
+
|
| 17 |
+
# Moving file to user's home directory
|
| 18 |
+
ADD . $HOME/app
|
| 19 |
+
|
| 20 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 21 |
+
COPY --chown=user . $HOME/app
|
| 22 |
+
|
| 23 |
+
# Loading Dependencies
|
| 24 |
+
RUN npm install
|
| 25 |
+
|
| 26 |
+
# Expose application's default port
|
| 27 |
+
EXPOSE 7860
|
| 28 |
+
|
| 29 |
+
# Entry Point
|
| 30 |
+
ENTRYPOINT ["nodejs", "./index.js"]
|