diff --git a/docker/Dockerfile b/docker/Dockerfile index 7420be8bb..9b8c44760 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -8,10 +8,12 @@ RUN apk add --no-cache --virtual build-dependencies --update wget curl ca-certif rm -rf /tmp/* EXPOSE 8080 +EXPOSE 8888 EXPOSE 9333 VOLUME /data +COPY filer.toml /etc/seaweedfs/filer.toml COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 3ccf596d5..6d6e9b140 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -2,7 +2,8 @@ version: '2' services: master: - image: chrislusf/seaweedfs + #image: chrislusf/seaweedfs # use a remote image + build: . # build our container from the local Dockerfile ports: - 9333:9333 command: "master" @@ -11,7 +12,8 @@ services: aliases: - seaweed_master volume: - image: chrislusf/seaweedfs + #image: chrislusf/seaweedfs # use a remote image + build: . # build our container from the local Dockerfile ports: - 8080:8080 command: 'volume -max=5 -mserver="master:9333" -port=8080' @@ -20,4 +22,17 @@ services: networks: default: aliases: - - seaweed_volume \ No newline at end of file + - seaweed_volume + filer: + #image: chrislusf/seaweedfs # use a remote image + build: . # build our container from the local Dockerfile + ports: + - 8888:8888 + command: 'filer -master="master:9333"' + depends_on: + - master + - volume + networks: + default: + aliases: + - seaweed_filer diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 34ab61148..6fd97ad9b 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -28,6 +28,14 @@ case "$1" in exec /usr/bin/weed $@ $ARGS ;; + 'filer') + ARGS="-ip `hostname -i`" + if [ -n "$MASTER_PORT_9333_TCP_ADDR" ] ; then + ARGS="$ARGS -master=$MASTER_PORT_9333_TCP_ADDR:$MASTER_PORT_9333_TCP_PORT" + fi + exec /usr/bin/weed $@ $ARGS + ;; + *) exec /usr/bin/weed $@ ;; diff --git a/docker/filer.toml b/docker/filer.toml new file mode 100644 index 000000000..35db3d012 --- /dev/null +++ b/docker/filer.toml @@ -0,0 +1,3 @@ +[leveldb] +enabled = true +dir = "."