Created
October 15, 2019 10:17
-
-
Save jakubhajek/bd41d926e5bf49aef1536cda793be57a to your computer and use it in GitHub Desktop.
Docker Swarm, an example stack file with NFS volume
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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