@@ -35,7 +35,7 @@ _This project is containerized using [**docker**](https://www.docker.com/). Ther
35
35
- For _ Windows_ or _ Mac_ (_ x86_64 / amd64_ ),
36
36
[ install _ Docker Desktop_ ] ( https://www.docker.com/products/docker-desktop ) .
37
37
38
- 2 . Open a teminal and navigate to working directory (where the source code will reside).
38
+ 2 . Open a terminal and navigate to working directory (where the source code will reside).
39
39
40
40
3 . _ Git Clone_ (additional [ installation] ( https://git-scm.com/downloads ) of _ Git_ required on
41
41
Windows) this repository using
@@ -73,24 +73,24 @@ Windows) this repository using
73
73
locally, it' ll not be rebuilt. To force a rebuild from the `Dockerfile` before launching the
74
74
_docker network_, add the `--build` flag.
75
75
76
- 5. In another terminal, run
76
+ 5. In a second terminal, run
77
77
78
78
```bash
79
79
docker attach musicblocks
80
80
```
81
81
82
- 6. The _Linux Debian 10.7_ (_buster_) _shell_ in the _docker container_ named _musicblocks_ is
83
- spawned and standard input/output is connected to the terminal.
82
+ The _Linux Debian 10.7_ (_buster_) _shell_ in the _docker container_ named _musicblocks_ is
83
+ spawned and standard input/output is connected to the terminal.
84
84
85
- _**Node**_ (_Node.js Runtime_), _**npm**_ (_Node Package Manager_), _**tsc**_ (_TypeScript
85
+ 6. _**Node**_ (_Node.js Runtime_), _**npm**_ (_Node Package Manager_), _**tsc**_ (_TypeScript
86
86
Compiler_), and _**ts-node**_ (_Node executable for TypeScript_) should be installed. Check
87
87
using
88
88
89
89
```bash
90
90
node --version && npm --version && tsc --version && ts-node --version
91
91
```
92
92
93
- Output should look like
93
+ in the second terminal. Output should look like
94
94
95
95
```bash
96
96
v14.16.1
@@ -99,26 +99,48 @@ spawned and standard input/output is connected to the terminal.
99
99
v9.1.1
100
100
```
101
101
102
- 7. To shut down the _docker network_, run (in the terminal where you ran `docker-compose up -d` or
103
- `docker compose up -d`)
102
+ The steps you take from here depend on what you want to do:
104
103
105
- ```bash
106
- docker-compose down
107
- ```
104
+ - **Run test suites and run a development server**
108
105
109
- or (for _Docker v1.28_ and above)
106
+ 1. To install all the dependencies (in `package.json`), run
110
107
111
- ```bash
112
- docker compose down
113
- ```
108
+ ```bash
109
+ npm ci
110
+ ```
114
111
115
- 8. To install all the dependencies (in `package.json`), run
112
+ 2. Run _React scripts_.
116
113
117
- ```bash
118
- npm ci
119
- ```
114
+ - For unoptimized development serving, run
115
+
116
+ ```bash
117
+ npm start
118
+ ```
119
+
120
+ This is spawned on `127.0.0.1:3000` inside the container, but mapped to `localhost:5000`
121
+ on host. Visit `localhost:5000` in a browser to view the webpage served.
122
+
123
+ Currently this will open a page with a "Hello world!" message.
124
+
125
+ - For testing, run
126
+
127
+ ```bash
128
+ npm run test
129
+ ```
130
+
131
+ - For generating a production build, run
132
+
133
+ ```bash
134
+ npm run build
135
+ ```
136
+
137
+ _**Note:**_ If you' re running using _Docker Desktop_ on _Windows_ or _Mac_, you might experience
138
+ longer execution times for these scripts. This happens due to cross-file-system communication.
139
+ Duration varies across machines; duration primarily depends on hard drive read/write speed.
120
140
121
- 9. To spawn a _HTTP Server_ (uses _Python 3_' s ` http.server` ), run
141
+ - ** HTTP server**
142
+
143
+ To spawn an _HTTP Server_ (uses _Python 3_' s `http.server`), run
122
144
123
145
```bash
124
146
npm run serve
@@ -127,34 +149,22 @@ spawned and standard input/output is connected to the terminal.
127
149
This is spawned on `0.0.0.0:80` inside the container, but mapped to `localhost:5001` on host.
128
150
Visit `localhost:5001` in a browser to view the webpage served.
129
151
130
- 10. Run _React scripts_.
131
-
132
- - For unoptimized development serving, run
133
-
134
- ` ` ` bash
135
- npm start
136
- ` ` `
152
+ - **Shut down docker network**
137
153
138
- This is spawned on ` 127.0.0.1:3000` inside the container, but mapped to ` localhost:5000` on
139
- host. Visit ` localhost:5000` in a browser to view the webpage served.
140
-
141
- - For testing, run
142
-
143
- ` ` ` bash
144
- npm run test
145
- ` ` `
154
+ To shut down the _docker network_, run (in the terminal where you ran `docker-compose up -d` or
155
+ `docker compose up -d`)
146
156
147
- - For generating a production build, run
157
+ ```bash
158
+ docker-compose down
159
+ ```
148
160
149
- ` ` ` bash
150
- npm run build
151
- ` ` `
161
+ or (for _Docker v1.28_ and above)
152
162
153
- _ ** Note: ** _ If you ' re running using _Docker Desktop_ on _Windows_ or _Mac_, you might experience
154
- longer execution times for these scripts. This happens due to cross-file-system communication.
155
- Duration varies across machines; duration primarily depends on hard drive read/write speed.
163
+ ```bash
164
+ docker compose down
165
+ ```
156
166
157
- 11. Miscellaneous commands.
167
+ - ** Miscellaneous commands**
158
168
159
169
- To launch the _Node runtime_, run
160
170
0 commit comments