A simple Node.js Hello World application.
- Node.js installed on your machine (for local development)
- Docker installed (for containerized deployment)
- Start the server:
npm start- Open your browser and navigate to
http://127.0.0.1:3001/
You should see "Hello World!" displayed in your browser.
Alternatively, you can run:
node index.js- Build the Docker image:
docker build -t tamir-demo .- Run the container:
docker run -p 3001:3001 tamir-demo- Open your browser and navigate to
http://127.0.0.1:3001/
To run the container in detached mode:
docker run -d -p 3001:3001 --name tamir-demo-app tamir-demoTo stop the container:
docker stop tamir-demo-appThis repository includes a GitHub Actions workflow that automatically builds and pushes Docker images to Docker Hub when a pull request is created.
To enable the workflow, you need to add a Docker Hub access token to your GitHub repository secrets:
-
Create a Docker Hub access token:
- Go to Docker Hub
- Navigate to Account Settings → Security → Access Tokens
- Click "New Access Token"
- Give it a name (e.g., "github-actions") and create it
- Copy the token (you won't be able to see it again)
-
Add the token to GitHub Secrets:
- Go to your GitHub repository
- Navigate to Settings → Secrets and variables → Actions
- Click "New repository secret"
- Name:
DOCKERHUB_TOKEN - Value: Paste the Docker Hub access token
- Click "Add secret"
When a pull request is created:
- The workflow automatically builds a Docker image
- Tags it as
doron/tamir-demo:<commit-hash>(first 7 characters of the commit SHA) - Pushes the image to Docker Hub under the username
doron
Example image tag: doron/tamir-demo:a1b2c3d