Skip to content

Commit 41fc7fc

Browse files
author
Craig
committed
updated run and readme to clearify params
1 parent 4725035 commit 41fc7fc

File tree

2 files changed

+22
-14
lines changed

2 files changed

+22
-14
lines changed

README.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -99,29 +99,29 @@ docker run -d -p 80:80 -e APP_MODULE="custom_app.custom_script:api" myimage
9999
### Waitress Options
100100

101101
#### Host & Port Setup
102-
By default, Waitress has been setup to server on all hostnames on port 80 using both IPv4 and IPv6. This translates to `--listen:*:80`. This works for most applications using the basic setups listed above.
102+
By default, Waitress has been setup to server on all hostnames on port 80 using both IPv4 and IPv6. This translates to `--listen=*:80`. This works for most applications using the basic setups listed above.
103103

104104
You may have different needs so you can adjust and manipulate this by passing in environment variable to adjust the settings.
105105

106-
There are 2 options for doing this:
106+
##### `WAITRESS_LISTEN`
107107

108+
Pass a comma separated list of host:port (EG: `host:post,host:port,host:port`) to the `WAITRESS_LISTEN` param
108109

109-
1. Pass a comma separated list of `host:port,host:port` to the `WAITRESS_LISTEN` param
110-
111-
The `WAITRESS_LISTEN` param takes precedence over `WAITRESS_HOST`/`WAITRESS_PORT` options, meaning if you include all 3, host and port settings will be ignored.
112-
113-
To set Waitress to use port 8080, sent the `WAITRESS_LISTEN` param like
110+
To set Waitress to use port 8080, sent the `WAITRESS_LISTEN` param like
114111
```bash
115112
docker run -d -p 80:8080 -e WAITRESS_LISTEN=*:8080 myimage
116113
````
117114

118-
2. Pass the host and port separately as `WAITRESS_HOST` and/or `WAITRESS_PORT`. If port is left out, it will default to 80.
115+
##### `WAITRESS_HOST` / `WAITRESS_PORT`
116+
Pass the host and port separately as `WAITRESS_HOST` and/or `WAITRESS_PORT`. If port is left out, it will default to 80.
119117

120118
If you want only IPv4, you could use advanced param listed in the section below, but you could also use
121119
```bash
122120
docker run -d -p 80:8080 -e WAITRESS_HOST=0.0.0.0 -e WAITRESS_PORT=8080 myimage
123121
````
124122
123+
**Note:** The `WAITRESS_LISTEN` param takes precedence over `WAITRESS_HOST` & `WAITRESS_PORT` options, meaning if you include all 3, `WAITRESS_HOST` & `WAITRESS_PORT` will be ignored.
124+
125125
#### Advanced Options
126126
127127
Many of the

scripts/run.sh

+14-6
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,23 @@ if [[ -v $WAITRESS_LISTEN ]]; then
2626
done
2727
else
2828
if [[ -v $WAITRESS_HOST ]]; then
29-
params="--host=$WAITRESS_HOST"
30-
if [[ -v $WAITRESS_PORT ]]; then
31-
params=" $params --port=$WAITRESS_PORT"
29+
if [[ -z $params ]]; then
30+
params="--host=$WAITRESS_HOST"
3231
else
33-
params=" $params --port=80"
32+
params=" $params --host=$WAITRESS_HOST"
3433
fi
35-
else
36-
params="--listen=*:80"
3734
fi
35+
if [[ -v $WAITRESS_PORT ]]; then
36+
if [[ -z $params ]]; then
37+
params="--port=$WAITRESS_PORT"
38+
else
39+
params=" $params --port=$WAITRESS_PORT"
40+
fi
41+
fi
42+
fi
43+
44+
if [[ -z $params ]]; then
45+
params="--listen=*:80"
3846
fi
3947

4048
if [[ -v $WAITRESS_NO_IPV6 ]]; then

0 commit comments

Comments
 (0)