File size: 609 Bytes
a9a717f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | # Use the official Node.js 18 image as the base image
FROM node:18
# Clone the repository into the current directory
RUN git clone https://github.com/Niansuh/uptime.git
# Set the working directory to the directory
WORKDIR "uptime"
# Install dependencies using npm
RUN npm install
# Build the project
RUN npm run build
# Create the data directory with proper permissions
RUN mkdir -p ./data && chown -R node:node ./data
# Expose port 3001 for the application
EXPOSE 3001
# Switch to the 'node' user
USER node
# Command to start the application when the container starts
CMD ["node", "server/server.js"] |