Olivier Massot 4 rokov pred
rodič
commit
d83b04677c

+ 13 - 3
docker/python39/Dockerfile

@@ -1,10 +1,20 @@
 FROM python:3.9.5-buster
 
+COPY /.ssh /root/.ssh
+
 WORKDIR /root/scripts
 
-RUN pip3 install path.py pyyaml docopt sshtunnel;
 
-RUN pip3 install -r /root/scripts/clonedb/requirements.txt
+RUN pip3 install path.py pyyaml docopt sshtunnel;
 
 RUN chown -R 1000:1000 /root/scripts;
-ENTRYPOINT ["tail", "-f", "/dev/null"]
+
+# Configure CloneDb
+RUN apt-get update; \
+    apt-get install -y mariadb-client-10.3;
+COPY ./docker/python39/conf/settings.yml /root/scripts/clonedb/
+
+# Declare the entrypoint.sh file
+COPY ./docker/python39/entrypoint.sh /entrypoint.sh
+RUN chmod +x /entrypoint.sh
+ENTRYPOINT ["/entrypoint.sh"]

+ 115 - 0
docker/python39/conf/settings.yml

@@ -0,0 +1,115 @@
+servers:
+  mariaDb:
+    host: db
+    description: Local MariaDb Docker
+    mysql:
+      port: 3306
+      username: root
+      password: mysql660
+
+  preprod:
+    host: preprod.2iopenservice.com
+    description: Preprod
+    mysql:
+      port: 3306
+      username: dbcloner
+      password: wWZ4hYcrmHLW2mUK
+    ssh:
+      key_file: ~/.ssh/id_rsa_exploitation
+      port: 22
+      user: exploitation
+
+  prod-back:
+    host: prod-back.2iopenservice.com
+    description: Prod-Back
+    mysql:
+      port: 3306
+      username: dbcloner
+      password: wWZ4hYcrmHLW2mUK
+    ssh:
+      key_file: ~/.ssh/id_rsa_exploitation
+      port: 22
+      user: exploitation
+
+  prod-front:
+    host: prod-front.2iopenservice.com
+    description: Prod-Front
+
+    mysql:
+      port: 3306
+      username: dbcloner
+      password: wWZ4hYcrmHLW2mUK
+    ssh:
+      key_file: ~/.ssh/id_rsa_exploitation
+      port: 22
+      user: exploitation
+
+users:
+  opentalent:
+    host: localhost
+    pwd: nSDC3Bm3ws88qKjV63
+
+  openassos:
+    host: localhost
+    pwd: Vq2icge7SM3P26CaC3
+
+  typo3:
+    host: localhost
+    pwd: Vq2icge7SM3P26CaC3
+
+operations:
+  crm:
+    dbname: crm
+    from_server: prod-back
+    to_server: mariaDb
+    is_default: True
+    compress: True
+    grant:
+      - opentalent
+
+  adminassos:
+    dbname: adminassos
+    from_server: prod-back
+    to_server: mariaDb
+    is_default: True
+    compress: True
+
+  openassos:
+    dbname: openassos
+    from_server: prod-front
+    to_server: mariaDb
+    is_default: True
+    compress: True
+    ignore_tables: ['Access', 'matomo.*', 'user_piwik.*', 'zzz_.*', 'tt_content_save', 'tt_content_v59']
+    structure_only: ['cf_cache_.*', 'sys_log']
+    grant:
+      - openassos
+
+  typo3:
+    dbname: typo3
+    from_server: prod-front
+    to_server: mariaDb
+    is_default: True
+    compress: True
+    structure_only: ['cf_cache_.*', 'sys_log']
+    grant:
+      - typo3
+
+  opentalent:
+    dbname: opentalent
+    from_server: prod-back
+    to_server: mariaDb
+    is_default: True
+    compress: True
+    structure_only: ['Audit_.*']
+    ignore_tables: []
+    ignore_views: []
+    grant:
+      - opentalent
+
+  metabase:
+    dbname: metabase
+    from_server: prod-back
+    to_server: mariaDb
+    is_default: True
+    compress: True

+ 7 - 0
docker/python39/entrypoint.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# recursively install every requirements.txt file in the /root/scripts/subdirs
+find . -iname 'requirements.txt' -exec pip3 install -r {} +
+
+# This last line only intends to keep the docker alive
+ENTRYPOINT ["tail", "-f", "/dev/null"]