mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
update Docker data persistent commands
parent
fd45daedb1
commit
c023479413
|
@ -138,13 +138,23 @@ docker build --no-cache -t 'chrislusf/seaweedfs' .
|
|||
### In production
|
||||
|
||||
You can use docker volumes to persist data:
|
||||
```bash
|
||||
# start our weed server daemonized
|
||||
docker run --name weed -d -p 9333:9333 -p 8080:8080 -p 18080:8080 \
|
||||
-v seaweedvolume:/data chrislusf/seaweedfs server -dir="/data" \
|
||||
-publicIp="$(curl -s cydev.ru/ip)"
|
||||
```
|
||||
|
||||
Alternatively, you can mount a directory on the host machine into the container:
|
||||
```bash
|
||||
# start our weed server daemonized
|
||||
docker run --name weed -d -p 9333:9333 -p 8080:8080 -p 18080:8080 \
|
||||
-v /opt/weedfs/data:/data chrislusf/seaweedfs server -dir="/data" \
|
||||
-publicIp="$(curl -s cydev.ru/ip)"
|
||||
```
|
||||
Note that according to [Docker's documentation](https://docs.docker.com/storage/volumes/), volumes are the preferred mechanism for persisting data.
|
||||
|
||||
|
||||
|
||||
Now our SeaweedFS server will be persistent and accessible by localhost:9333, :8080 and :18080 on host machine.
|
||||
Dont forget to specify "-publicIp" for correct connectivity.
|
||||
|
|
Loading…
Reference in a new issue