Spaces:
Sleeping
Sleeping
# Use the node:18 image as the base image | |
FROM node:18 | |
# Set the environment variable for non-interactive installation | |
ARG DEBIAN_FRONTEND=noninteractive | |
# Set an environment variable (adjust this as needed) | |
ENV BING_HEADER "" | |
# Set home to the user's home directory | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
# Set up a new user named "user" with user ID 1000 | |
RUN useradd -o -u 1000 user && mkdir -p $HOME/app && chown -R user $HOME | |
# Install git | |
USER root | |
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | |
# Switch to the "user" user | |
USER user | |
# Set the working directory to the user's home directory | |
WORKDIR $HOME/app | |
# Clone your git repository (replace YOUR_GIT_REPO_URL with your actual repo URL) | |
RUN git clone https://github.com/johnpaulbin/bongo . | |
# Install the node modules and build your project | |
# Uncomment these lines if needed | |
# RUN npm install | |
# RUN npm run build | |
# Remove the src directory if not needed | |
# RUN rm -rf src | |
WORKDIR $HOME/app/bongo | |
# Set an environment variable for the port | |
ENV PORT 7860 | |
# Expose the port | |
EXPOSE 7860 | |
# Define the command to start the app | |
RUN npm i | |
RUN npm run build | |
CMD ["npm", "start"] | |