Browse Source

增加docker gpu 配置

root 1 year ago
parent
commit
2a73149a89
1 changed files with 26 additions and 14 deletions
  1. 26 14
      deploy/docker_compose/docker-compose.yaml

+ 26 - 14
deploy/docker_compose/docker-compose.yaml

@@ -1,15 +1,27 @@
-version: '3.7'
+# version: '3.7'
+# services:
+#   app:
+#     build:
+#       context: .
+#       args:
+#         - work_dir=/app
+#     environment:
+#       - FLASK_APP_PATH=/app/server.py
+#       - FLASK_PORT=5000
+#     working_dir: /app
+#     volumes:
+#       - './:/app'
+#     ports:
+#       - 5000:5000
+
 services:
-  app:
-    build:
-      context: .
-      args:
-        - work_dir=/app
-    environment:
-      - FLASK_APP_PATH=/app/server.py
-      - FLASK_PORT=5000
-    working_dir: /app
-    volumes:
-      - './:/app'
-    ports:
-      - 5000:5000
+  test:
+    image: nvidia/cuda:10.2-base
+    command: nvidia-smi
+    deploy:
+      resources:
+        reservations:
+          devices:
+            - driver: nvidia
+              count: 1
+              capabilities: [gpu]