Open NfreerCom opened 7 months ago
FROM node:14
WORKDIR /app
RUN echo '{ "name": "my-app", "version": "1.0.0", "scripts": { "start": "node index.js" }, "dependencies": { "express": "^4.17.1" } }' > package.json
RUN npm install
COPY . .
EXPOSE 3000
CMD [ "npm", "start" ]
Use an official Node runtime as a parent image
FROM node:14
Set the working directory in the container
WORKDIR /app
Create a package.json file with your desired configuration
RUN echo '{ "name": "my-app", "version": "1.0.0", "scripts": { "start": "node index.js" }, "dependencies": { "express": "^4.17.1" } }' > package.json
Install app dependencies
RUN npm install
Bundle app source
COPY . .
Your application-specific commands go here
Expose the port on which your app will run
EXPOSE 3000
Define the command to run your app
CMD [ "npm", "start" ]