File tree Expand file tree Collapse file tree 1 file changed +20
-29
lines changed Expand file tree Collapse file tree 1 file changed +20
-29
lines changed Original file line number Diff line number Diff line change 1
- **************
2
- node-webserver
3
- **************
1
+ # node-webserver
4
2
5
3
Provides a minimal webserver (via Express.js) to expose static files from the Docker host via HTTP.
6
4
This image is build on Alpine Linux (base image ` alpine:node ` ) and aims for a minimal size.
7
5
8
- Usage
9
- =====
6
+ ## Usage
10
7
11
8
You can expose a local directory which you want to have served via the ` mini-webserver ` by starting it with
12
9
13
10
` docker run --name node-web -p 8080:8080 -v $PWD/test:/app/public:ro -d netresearch/node-webserver `
14
11
15
12
In this example, the port on the docker host where the ` node-webserver ` is reachable is ` 8080 ` .
16
13
17
- ----------------------
18
- docker-compose example
19
- ----------------------
20
-
21
- .. code :: yaml
22
-
23
- version : ' 3.5'
24
- services :
25
- app :
26
- image : netresearch/node-webserver
27
- environment :
14
+ ### docker-compose.yml example
15
+
16
+ ``` yaml
17
+ version : ' 3.5'
18
+ services :
19
+ app :
20
+ image : netresearch/node-webserver
21
+ environment :
28
22
- VIRTUAL_HOST=my.example.com
29
23
- VIRTUAL_NETWORK=webproxy
30
24
- VIRTUAL_PORT=8080
31
- volumes :
25
+ volumes :
32
26
- ./app:/app/public:ro
33
- restart : always
27
+ restart : always
34
28
35
- networks :
36
- default :
37
- external :
38
- name : webproxy
29
+ networks :
30
+ default :
31
+ external :
32
+ name : webproxy
33
+ ` ` `
39
34
40
- -------------
41
- Customization
42
- -------------
35
+ ### Customization
43
36
44
- You can override ` customize.js < customize.js >`_ in order to customize the ` express application < http://expressjs.com/en/4x/api.html#app >`_.
37
+ You can override [ customize.js]( customize.js) in order to customize the [ express application]( http://expressjs.com/en/4x/api.html#app)
45
38
46
- -------
47
- Logging
48
- -------
39
+ ### Logging
49
40
50
41
The Express.js app uses ` morgan` to pipe the web logs to the `STDOUT`. This means that the logs are visible via
51
42
` docker logs node-web` (if the container name is `node-web`).
You can’t perform that action at this time.
0 commit comments