Skip to content

Commit 18f4917

Browse files
committed
Update deployment instructions to avoid --net host
1 parent 1e55f98 commit 18f4917

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,15 +113,24 @@ Deployment
113113
To install the application from Docker, run the following command:
114114

115115
```console
116-
$ docker run -d --restart unless-stopped --name $NAME -v $CONFIG:/app/conf/application.conf --env-file $ENV_FILE --net host codingteam/loglist:$VERSION
116+
$ docker run -d --restart unless-stopped \
117+
--name $NAME \
118+
-v $CONFIG:/app/conf/application.conf \
119+
--env-file $ENV_FILE \
120+
--add-host db:$DB_IP \
121+
-p:$PORT:9000 \
122+
codingteam/loglist:$VERSION
117123
```
118124

119125
Where
120126
- `$NAME` is the container name
121127
- `$CONFIG` is the **absolute** path to the configuration file
128+
- `$ENF_FILE` is the path to the env file (see
129+
[`docs/loglist.env`][docs-loglist.env] for example)
130+
- `$DB_IP` is the IP address of the database service
131+
- `$PORT` is external port the site will be available on
122132
- `$VERSION` is the version you want to deploy, or `latest` for the latest
123133
available one
124-
- `$ENF_FILE` is the path to the env file (see `docs/loglist.env` for example)
125134

126135
For example, a production server may use the following settings (note this
127136
command uses the Bash syntax; adapt for your shell if necessary):
@@ -130,10 +139,18 @@ command uses the Bash syntax; adapt for your shell if necessary):
130139
NAME=loglist
131140
CONFIG=/opt/loglist/conf/application.conf
132141
VERSION=latest
142+
PORT=9000
133143
ENV_FILE=/opt/loglist/conf/loglist.env
144+
DB_IP=`ip -4 addr show scope global dev docker0 | grep inet | awk '{print $2}' | cut -d / -f 1 | sed -n 1p`
134145
docker pull codingteam/loglist:$VERSION
135146
docker rm -f $NAME
136-
docker run -d --restart unless-stopped --name $NAME -v $CONFIG:/app/conf/application.conf --env-file $ENV_FILE --net host codingteam/loglist:$VERSION
147+
docker run -d --restart unless-stopped \
148+
--name $NAME \
149+
-v $CONFIG:/app/conf/application.conf \
150+
--env-file $ENV_FILE \
151+
--add-host db:$DB_IP \
152+
-p:$PORT:9000 \
153+
codingteam/loglist:$VERSION
137154
```
138155

139156
License
@@ -149,6 +166,7 @@ corresponding site section for further details.
149166

150167
[docs-admin]: docs/Admin.md
151168
[docs-api]: docs/API.md
169+
[docs-loglist.env]: docs/loglist.env
152170

153171
[docker-hub]: https://hub.docker.com/r/codingteam/loglist
154172
[loglist]: https://www.loglist.xyz/

0 commit comments

Comments
 (0)