Created
September 23, 2023 11:13
-
-
Save ashishjullia/e1aa2bff23b2646fd8f8a615a2cbd90c to your computer and use it in GitHub Desktop.
nodejs-dockerfile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Specify the base image | |
FROM node:16-alpine | |
ARG MYSQL_HOST \ | |
MYSQL_PORT | |
ENV MYSQL_HOST=$MYSQL_HOST \ | |
MYSQL_PORT=$MYSQL_PORT | |
# Set the working directory in the container | |
WORKDIR /app | |
# Copy package.json and package-lock.json (if available) to the container | |
COPY package*.json ./ | |
# Install project dependencies | |
RUN npm install | |
# Copy the entire project directory to the container | |
COPY . . | |
# Specify the command to run your Node.js application | |
CMD ["node", "index.js"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment