Skip to content

Instantly share code, notes, and snippets.

@jakubhajek
Created October 15, 2019 10:17
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jakubhajek/bd41d926e5bf49aef1536cda793be57a to your computer and use it in GitHub Desktop.
Save jakubhajek/bd41d926e5bf49aef1536cda793be57a to your computer and use it in GitHub Desktop.
Docker Swarm, an example stack file with NFS volume
# docker stack deploy -c stack-nfs.yml nfs
#
# This is an example compose file with data volume mounted from remote server via NFS protocol
version: "3.7"
services:
nginx:
image: nginx:1.17
ports:
- "8080:8080"
networks:
- nfs
volumes:
- "nfsdata:/usr/share/nginx/html"
networks:
nfs:
driver: overlay
attachable: true
volumes:
nfsdata:
driver: local
driver_opts:
type: "nfs"
o: "addr=10.16.104.4,rw,bg,hard,vers=3,proto=tcp,timeo=600,rsize=65536,wsize=65536,nointr"
device: ":/zpool-123456/vol-name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment