dec023/Dockerfile
2024-12-23 11:27:17 +05:30

24 lines
606 B
Docker

# Use an official Node.js image from the Docker Hub
FROM node:18
# Set the working directory inside the container
WORKDIR /
RUN npm config set registry https://registry.npmmirror.com
RUN npm install -g npm@10.8.2
# Copy package.json and package-lock.json (if available)
COPY package*.json ./
# Install dependencies
RUN rm -rf node_modules package-lock.json && npm cache clean --force
# Install dependencies
RUN npm install --legacy-peer-deps
# Copy the rest of the application code
COPY . .
# Expose the port the app will run on
EXPOSE 8081
# Command to start the application
CMD ["node", "index.js"]