Skip to content

Instantly share code, notes, and snippets.

@Shashankreddysunkara
Forked from jakubhajek/stack-nfs.yml
Created December 11, 2021 05:16
Show Gist options
  • Save Shashankreddysunkara/820b3c36f7eaea568cf74bd14727655f to your computer and use it in GitHub Desktop.
Save Shashankreddysunkara/820b3c36f7eaea568cf74bd14727655f 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