mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Add environment variables
parent
cc6a289b52
commit
3f26403bda
36
Environment-Variables.md
Normal file
36
Environment-Variables.md
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
# Environment Variables
|
||||||
|
You can use environment variables instead of arguments for `weed`.
|
||||||
|
For example:
|
||||||
|
instead of `weed master -port 5000 -mdir /tmp -volumePreallocate` you can use
|
||||||
|
```shell
|
||||||
|
export PORT=5000
|
||||||
|
export MDIR=/tmp
|
||||||
|
export VOLUMEPREALLOCATE=true # or export VOLUMEPREALLOCATE=
|
||||||
|
weed master
|
||||||
|
```
|
||||||
|
|
||||||
|
# Docker
|
||||||
|
This is useful for using docker and docker compose
|
||||||
|
You have to override entrypoint to `weed` because defautl [entrypoint](https://github.com/seaweedfs/seaweedfs/blob/master/docker/entrypoint.sh) use default values for `volumeSizeLimitMB`, `volumePreallocate`, `mdir`, `dir`, `max` argumants and setting environment variables won't change these values.
|
||||||
|
## Dcoker
|
||||||
|
```shell
|
||||||
|
docker run --entrypoint weed -it -e MDIR=/tmp -e PORT=5000 -e VOLUMEPREALLOCATE=true chrislusf/seaweedfs:3.45 master
|
||||||
|
```
|
||||||
|
|
||||||
|
## Docker Compose
|
||||||
|
```yaml
|
||||||
|
version: '3.9'
|
||||||
|
services:
|
||||||
|
master:
|
||||||
|
image: chrislusf/seaweedfs:3.45
|
||||||
|
ports:
|
||||||
|
- 9333:9333
|
||||||
|
- 19333:19333
|
||||||
|
environment:
|
||||||
|
MDIR: /data
|
||||||
|
PORT: 9333
|
||||||
|
VOLUMEPREALLOCATE: 'true'
|
||||||
|
# or `VOLUMEPREALLOCATE:`
|
||||||
|
entrypoint: weed
|
||||||
|
command: master
|
||||||
|
```
|
Loading…
Reference in a new issue