diff --git a/Environment-Variables.md b/Environment-Variables.md new file mode 100644 index 0000000..13d3b09 --- /dev/null +++ b/Environment-Variables.md @@ -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 +```