Skip to content

Commit d143974

Browse files
authored
Merge pull request #37 from weaponsforge/dev
v2.1.4
2 parents 9732ef9 + 1b849a6 commit d143974

File tree

2 files changed

+39
-17
lines changed

2 files changed

+39
-17
lines changed

README.md

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Its development static hosting and file-serving architecture are closer to tradi
88
> An alternate localhost static development environment using **Webpack**, also with live reload, is available at<br>
99
> https://github.com/weaponsforge/livereload-webpack
1010
11+
> [!TIP]
12+
> Are you using **VSCode** and **want to do live reload** but **do not want to install livereload-basic's Node dependencies** or **run it using Docker**?
13+
> [Live Server](https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer) might be the tool for you. Check it out from from the Visual Studio Marketplace.
14+
1115
### Content
1216

1317
- [Dependencies](#dependencies)
@@ -56,15 +60,18 @@ These steps use **Node** and **Yarn** to run the development app.
5660
1. Run the localhost static website development environment.<br>
5761
`yarn dev`
5862

59-
2. Edit the existing static files from the **./public** directory and wait for live reload. Your updates will reflect on the web browser.
63+
2. Launch the local development website at:<br>
64+
`http://localhost:3000`
65+
66+
3. Edit the existing static files from the **./public** directory and wait for live reload. Your updates will reflect on the web browser.
6067

61-
3. To include new static website files on live reload:
68+
4. To include new static website files on live reload:
6269
- Create new static (.html, .js, .css) files inside the **./public** directory.
6370
- Refresh the web browser.
6471
- Restart the web server if updates don't show after a while.<br>
6572
`yarn dev`
6673

67-
4. Run the production static website (does not use live reload).<br>
74+
5. Run the production static website (does not use live reload).<br>
6875
`yarn start`
6976

7077
## Available Scripts
@@ -90,9 +97,9 @@ This project deploys the latest **development** Docker image to Docker Hub on th
9097

9198
https://hub.docker.com/r/weaponsforge/livereload-basic
9299

93-
1. Pull the pre-built development Docker image using any of the two (2) options:
100+
1. Pull the "latest" pre-built development Docker image using any of the two (2) options:
94101
- Open a terminal and run:<br>
95-
`docker pull weaponsforge/livereload-basic:latest`
102+
`docker pull weaponsforge/livereload-basic`
96103
- Navigate to the livereload-basic root project directory, then run:<br>
97104
`docker compose -f docker-compose.dev.yml pull`
98105

@@ -108,24 +115,35 @@ https://hub.docker.com/r/weaponsforge/livereload-basic
108115
```
109116
Navigate to the root project directory (for example, `"my-website-project"`) using a terminal, then run:
110117

111-
```
118+
```bash
112119
# On Linux OS
113-
docker run -it --rm -p 3000:3000 -v $(pwd)/FILE_DIRECTORY:/opt/app/public weaponsforge/livereload-basic:latest
120+
docker run -it --rm -p 3000:3000 -v $(pwd)/FILE_DIRECTORY:/opt/app/public weaponsforge/livereload-basic
114121

115-
# On Windows OS
116-
docker run -it --rm -p 3000:3000 -v %cd%\FILE_DIRECTORY:/opt/app/public -e USE_POLLING=true weaponsforge/livereload-basic:latest
122+
# On Windows OS (Command Prompt)
123+
docker run -it --rm -p 3000:3000 -v %cd%\FILE_DIRECTORY:/opt/app/public -e USE_POLLING=true weaponsforge/livereload-basic
117124
```
118125

119-
> _**TIP:**<br>
120-
> Replace `-p 3000:3000` with other port bindings as needed._
126+
> 💡**TIP:**<br>
127+
> _To use other port bindings aside from the default `3000`:_
128+
> 1. Add a `PORT` environment variable eg., `-e PORT=3003`
129+
> 2. Replace `-p 3000:3000` with the `PORT` environment variable.
121130

122131
- Using Docker compose (2nd option):<br>
123132
- `docker compose -f docker-compose.dev.yml up`
124-
- > **INFO:** Uncomment the following lines in the `docker-compose.dev.yml` file when working in a Windows host.
133+
- > **INFO:** Uncomment the following lines in the `docker-compose.dev.yml` file when working in a **Windows host**.
134+
```yml
135+
environment:
136+
# Enable USE_POLLING if working in Windows WSL2 to enable live reload
137+
- USE_POLLING=true
125138
```
126-
# Enable USE_POLLING if working in Windows WSL2 to enable live reload
127-
environment:
128-
- USE_POLLING=true
139+
- > **INFO:** Enable using **other ports** - uncomment the following lines in the `docker-compose.dev.yml` and expose the new port under the `"ports"` section.
140+
```yml
141+
ports:
142+
- "3002:3002"
143+
environment:
144+
# Use other ports aside from the 3000 default
145+
# Ensure to map and expose this port under the "ports" section eg., -"3002:3002"
146+
- PORT=3002
129147
```
130148
3. Refer to the [Usage](#usage) section steps **# 2 - # 4** for local development.
131149

@@ -154,7 +172,7 @@ The **development** Docker image contains Node runtime, Gulp, Browser-Sync and Y
154172

155173
### Production Image
156174

157-
The **production** Docker image contains the static website running in an nginx container for minimal production website build. Build it with:
175+
The **production** Docker image contains the static website running in an Nginx container for minimal production website build. Build it with:
158176

159177
`docker compose -f docker-compose.prod.yml build`
160178

docker-compose.dev.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ services:
1212
ports:
1313
- "3000:3000"
1414
- "9229:9229"
15-
# Enable USE_POLLING if working in Windows WSL2 to enable live reload
1615
# environment:
16+
# Enable USE_POLLING if working in Windows WSL2 to enable live reload
1717
# - USE_POLLING=true
18+
#
19+
# Use other ports aside from the default 3000
20+
# Ensure to map and expose this port under the "ports" section eg., -"3002:3002"
21+
# - PORT=3002

0 commit comments

Comments
 (0)