version: "3.8" services: test1: image: stress-test build: context: ./ dockerfile: stressDockerfile environment: - NVIDIA_VISIBLE_DEVICES=all working_dir: /gpu-burn command: [ "./gpu_burn", "120" ] deploy: resources: reservations: devices: - 'driver': 'nvidia' 'count': 1 'capabilities': ['gpu', 'utility', 'compute'] test2: image: stress-test build: context: ./ dockerfile: stressDockerfile environment: - NVIDIA_VISIBLE_DEVICES=all working_dir: /gpu-burn command: [ "./gpu_burn", "120" ] deploy: resources: reservations: devices: - 'driver': 'nvidia' 'count': 1 'capabilities': ['gpu', 'utility', 'compute']