Building and Starting the Project
This guide will provide a step-by-step walkthrough of building and starting the benhall/express-demo project.
Prerequisites
Ensure you have the following installed on your system:
- Node.js and npm
- Docker
Building the Project
Clone the repository:
git clone https://github.com/benhall/express-demo.git cd express-demo
Install dependencies:
npm install
Starting the Project
Build the Docker image:
docker-compose build
This command builds a Docker image using the
Dockerfile
within the project.Start the application:
docker-compose up -d
This command starts the Docker container in the background.
Access the application:
The application will be available at
http://localhost:3000
.This project exposes port 3000 as defined in the
docker-compose.yml
file:version: "3.9" services: web: build: . ports: - "3000:3000"
The
docker-compose up -d
command starts the container in the background, allowing you to access the application without blocking your terminal.You can see the application running in your web browser.
Stopping the Project
To stop the application, use the following command:
docker-compose down
This will stop and remove the Docker container.
Note: Ensure you have the latest versions of Node.js, npm, and Docker installed for optimal compatibility.