Commit 10034cfe authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Fix deployment and nfs config

Separate export definition in different variables.
Remove second export definition.
Remove udp port mapping.

Add nfs options:
  no_root_squash - allow root (uid=0) user access
  async - omit waiting for operations to end
  crossmnt - allow users to switch from root export to subexport
parent 758c2afe
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
NFS_SERVER_PORT=2049
NFS_SERVER_EXPOSED_PORT=2049
NFS_SERVER_PORT_MODE=host
NFS_EXPORT_0=/nfs 10.0.0.0/8(ro,fsid=0,insecure,no_subtree_check)
NFS_EXPORT_1=/nfs/docker-config 10.0.0.0/8(rw,insecure,no_subtree_check,wdelay,root_squash)
NFS_VERSION=4.2
NFS_PORT=2049
NFS_EXPOSED_PORT=2049
NFS_PORT_MODE=host
NFS_ROOT_PATH=/nfs
NFS_ROOT_ADDR=10.0.0.0/8
NFS_ROOT_OPTS=rw,fsid=0,crossmnt,insecure,no_subtree_check,no_root_squash,async
+9 −12
Original line number Diff line number Diff line
@@ -5,24 +5,21 @@ services:
    image: ${IMAGE_NAME:-erichough/nfs-server}:${IMAGE_TAG:-latest}
    container_name: nfs-server
    environment:
      NFS_PORT: ${NFS_SERVER_PORT}
      NFS_VERSION: '4.2'
      NFS_PORT:
      NFS_VERSION:
      NFS_DISABLE_VERSION_3: 1
      NFS_EXPORT_0:
      NFS_EXPORT_1:
      NFS_EXPORT_0: ${NFS_ROOT_PATH} ${NFS_ROOT_ADDR}(${NFS_ROOT_OPTS})
    ports:
      - target: ${NFS_SERVER_PORT}
        published: ${NFS_SERVER_EXPOSED_PORT}
      - target: ${NFS_PORT}
        published: ${NFS_EXPOSED_PORT}
        protocol: tcp
        mode: ${NFS_SERVER_PORT_MODE}
      - target: ${NFS_SERVER_PORT}
        published: ${NFS_SERVER_EXPOSED_PORT}
        protocol: udp
        mode: ${NFS_SERVER_PORT_MODE}
        mode: ${NFS_PORT_MODE}
    volumes:
      - data-vol:/nfs
      - data-vol:${NFS_ROOT_PATH}
      - /lib/modules:/lib/modules:ro
    cap_add:
      - SYS_ADMIN
      - SYS_MODULE
    restart: always

volumes: