Spaces:
Sleeping
Sleeping
Commit
·
7da1fa6
1
Parent(s):
9f1ddc6
Update Dockerfile
Browse files- Dockerfile +52 -5
Dockerfile
CHANGED
|
@@ -1,5 +1,52 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use the node:18 image as the base image
|
| 2 |
+
FROM node:18
|
| 3 |
+
|
| 4 |
+
# Set the environment variable for non-interactive installation
|
| 5 |
+
ARG DEBIAN_FRONTEND=noninteractive
|
| 6 |
+
|
| 7 |
+
# Set an environment variable (adjust this as needed)
|
| 8 |
+
ENV BING_HEADER ""
|
| 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 up a new user named "user" with user ID 1000
|
| 15 |
+
RUN useradd -o -u 1000 user && mkdir -p $HOME/app && chown -R user $HOME
|
| 16 |
+
|
| 17 |
+
# Install git
|
| 18 |
+
USER root
|
| 19 |
+
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
|
| 20 |
+
|
| 21 |
+
# Switch to the "user" user
|
| 22 |
+
USER user
|
| 23 |
+
|
| 24 |
+
# Set the working directory to the user's home directory
|
| 25 |
+
WORKDIR $HOME/app
|
| 26 |
+
|
| 27 |
+
# Clone your git repository (replace YOUR_GIT_REPO_URL with your actual repo URL)
|
| 28 |
+
RUN git clone https://github.com/johnpaulbin/bongo .
|
| 29 |
+
|
| 30 |
+
# Install the node modules and build your project
|
| 31 |
+
# Uncomment these lines if needed
|
| 32 |
+
# RUN npm install
|
| 33 |
+
# RUN npm run build
|
| 34 |
+
|
| 35 |
+
# Remove the src directory if not needed
|
| 36 |
+
# RUN rm -rf src
|
| 37 |
+
|
| 38 |
+
WORKDIR $HOME/app/bongo
|
| 39 |
+
|
| 40 |
+
# Set an environment variable for the port
|
| 41 |
+
ENV PORT 7860
|
| 42 |
+
|
| 43 |
+
# Expose the port
|
| 44 |
+
EXPOSE 7860
|
| 45 |
+
|
| 46 |
+
# Define the command to start the app
|
| 47 |
+
|
| 48 |
+
CMD ["npm", "i"]
|
| 49 |
+
|
| 50 |
+
CMD ["npm", "run", "build"]
|
| 51 |
+
|
| 52 |
+
CMD ["npm", "start"]
|