docker service create --name web --env NODE_ENV=production --replicas 3 nginx:1.26
Create a service with environment variables
Deploys three nginx replicas with NODE_ENV=production injected into each task. --env-file loads variables from a file instead. Update later with docker service update --env-add.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.