Open 3bdoYasser opened 1 year ago
CREATE Dockerfile
# Use an official Node runtime as the parent image
FROM node:14
# Set the working directory in the container to /app
WORKDIR /app
# Copy package.json and package-lock.json to the working directory
COPY package*.json ./
# Install any needed packages specified in package.json
RUN npm install
# Bundle app source inside the docker image
COPY . .
# Make port 3000 available to the world outside this container
EXPOSE 3000
# Define the command to run the app
CMD [ "npm", "start" ]
CREATE docker-compose.yml
version: '3'
services:
app:
build: .
ports:
- "3000:3000"
volumes:
- .:/app
environment:
- NODE_ENV=development
Instructions:
docker build -t simple-test .
in your terminal.docker run -p 3000:3000 simple-test
.docker-compose up
in your terminal.http://localhost:3000
to view the app.
add docker file and docker-compose and make all configurations and make sure that the whole project works