Create Dockerhubfile

This commit is contained in:
prafull-opensignlabs
2024-02-22 18:44:07 +05:30
committed by GitHub
parent 5974515362
commit 1c7c3a4777
+27
View File
@@ -0,0 +1,27 @@
# Use an official Node runtime as the base image
FROM node:16
# Set the working directory inside the container
WORKDIR /usr/src/app
# Copy package.json and package-lock.json first to leverage Docker cache
COPY ./package*.json ./
# Install application dependencies
RUN npm install
# If you have native dependencies, you'll need extra tools. Uncomment the following line if needed.
# RUN apk add --no-cache make gcc g++ python3
# Copy the current directory contents into the container
COPY ./ .
# Make port 8080 available to the world outside this container
EXPOSE 8080
# Define environment variables if needed
# ENV NODE_ENV production
# ENV DATABASE_URL mongodb://db:27017
# Run the application
CMD ["npm", "start"]