Spaces:
Sleeping
Sleeping
FROM node:23.7.0 as builder | |
# Install git | |
RUN apt-get update && apt-get install -y git | |
# Clone the GitHub repository (if not already cloned) | |
RUN rm -rf /usr/src/app && git clone https://github.com/abubasith456/Node-WLA.git /usr/src/app | |
# Set the working directory | |
WORKDIR /usr/src/app | |
# Change ownership of the directory to the current user (node) | |
RUN chown -R node:node /usr/src/app | |
# Mark the repository directory as safe | |
USER node | |
RUN git config --global --add safe.directory /usr/src/app | |
# Install npm dependencies | |
RUN npm install | |
# Expose the port your application runs on | |
EXPOSE 5000 | |
# Ensure that the latest code is pulled before starting the app | |
CMD git pull origin main && npm install && npm start | |