Переглянути джерело

添加docker镜像与编排脚本

dongzhaorui 2 роки тому
батько
коміт
6d011ba4b4

+ 0 - 3
find_source/Dockerfile

@@ -15,6 +15,3 @@ COPY . .
 RUN pip install -i https://pypi.tuna.tsinghua.edu.cn/simple --upgrade pip
 RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
 RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple --root-user-action=ignore
-
-# 启动参数
-CMD ["python", "build_excavate.py", "10"]

+ 17 - 0
find_source/data_excavate.yml

@@ -0,0 +1,17 @@
+version: "3" # 必须指定docker-compose版本, 需要和docker版本对应
+services: # 一组容器
+  data_excavate: # 服务名称
+    container_name: data_excavate
+    image: find_source:1.0
+    volumes: # 映射文件夹
+      - /mnt/dzr/find_source:/app
+    network_mode: "host" # 指定网络名称
+    restart: always
+    privileged: true
+    shm_size: 10GB
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "200k"
+        max-file: "10"
+    command: 'python build_excavate.py 10'

+ 17 - 0
find_source/data_synchronism.yml

@@ -0,0 +1,17 @@
+version: "3" # 必须指定docker-compose版本, 需要和docker版本对应
+services: # 一组容器
+  data_synchronism: # 服务名称
+    container_name: data_synchronism
+    image: find_source:1.0
+    volumes: # 映射文件夹
+      - /mnt/dzr/find_source:/app
+    network_mode: "host" # 指定网络名称
+    restart: always
+    privileged: true
+    shm_size: 10GB
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "200k"
+        max-file: "10"
+    command: 'python build_sync_data.py'