Explorar o código

service cloudRun primo commit

mauro hai 1 mes
achega
92b5031c19
Modificáronse 14 ficheiros con 129 adicións e 0 borrados
  1. 48 0
      docker-compose.yml
  2. 5 0
      nginx.bpc/loop.sh
  3. 7 0
      nginx.bpc/nginx.bpc
  4. 5 0
      nginx.bpc/run.sh
  5. 5 0
      python/django.bpc
  6. 5 0
      python/django.gd
  7. 3 0
      python/django4
  8. 4 0
      python/django5
  9. 5 0
      python/loop.sh
  10. 10 0
      python/python
  11. 9 0
      python/run.bpc.sh
  12. 9 0
      python/run.gd.sh
  13. 9 0
      python/run.sh
  14. 5 0
      python/start

+ 48 - 0
docker-compose.yml

@@ -0,0 +1,48 @@
+services:
+  start:
+    image: start
+    build:
+      context: python
+      dockerfile: start
+
+  python:
+    image: python
+    build:
+      context: python
+      dockerfile: python
+    depends_on:
+      - start 
+
+  # spacchettatore di pdf per l'amministrazione
+  bpconverter:
+    image: django.bcp
+    build:
+      context: python
+      dockerfile: django.bpc
+    depends_on:
+      - python
+    ports: 
+      - 8220:8220
+    volumes:
+      - /home/data/bpconverter:/home/bpconverter
+    environment:
+      - PORT=8220
+      - V=5
+    entrypoint: ['/bin/bash','/root/run.sh']
+    restart: unless-stopped
+
+  # bpconverter: supporto per la fornitura di file e immagini
+  bpconverter.nginx:
+    image: nginx.bpc
+    build:
+      context: nginx.bpc
+      dockerfile: nginx.bpc
+    ports:
+      - 8225:80
+    volumes:
+      - /home/data/bpconverter.nginx:/etc/nginx
+      - /home/data/bpconverter:/home/bpconverter
+    entrypoint: ['/bin/bash','/root/run.sh']
+    restart: unless-stopped
+    depends_on:
+      - start 

+ 5 - 0
nginx.bpc/loop.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+#
+echo "Running ...."
+touch /tmp/nulfile.txt
+tail -f /tmp/nulfile.txt

+ 7 - 0
nginx.bpc/nginx.bpc

@@ -0,0 +1,7 @@
+from start as nginx.d4
+run apt install nginx-full -y
+run ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
+copy run.sh /root/run.sh
+copy loop.sh /root/loop.sh
+run chmod a+x /root/run.sh
+run chmod a+x /root/loop.sh

+ 5 - 0
nginx.bpc/run.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+#
+/etc/init.d/nginx start
+touch /tmp/nginx.txt
+tail -f /tmp/nginx.txt

+ 5 - 0
python/django.bpc

@@ -0,0 +1,5 @@
+from python as django5
+run . ./home/runtime/bin/activate && pip install django && pip install pypdf2
+run ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
+copy run.bpc.sh /root/run.sh
+

+ 5 - 0
python/django.gd

@@ -0,0 +1,5 @@
+from python as django5
+run . ./home/runtime/bin/activate && pip install django && pip install pypdf2 && pip install python-codicefiscale
+run ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
+copy run.gd.sh /root/run.sh
+

+ 3 - 0
python/django4

@@ -0,0 +1,3 @@
+from python as django4
+run . ./home/runtime/bin/activate && pip install django==4.2.8
+run ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime

+ 4 - 0
python/django5

@@ -0,0 +1,4 @@
+from python as django5
+run . ./home/runtime/bin/activate && pip install django
+run ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
+

+ 5 - 0
python/loop.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+#
+echo "Running ...."
+touch /tmp/nulfile.txt
+tail -f /tmp/nulfile.txt

+ 10 - 0
python/python

@@ -0,0 +1,10 @@
+from start as python
+run apt install python3-pip python3-venv python-is-python3 -y
+run apt install python3-dev default-libmysqlclient-dev build-essential pkg-config -y
+run cd /home && python -mvenv runtime
+run . /home/runtime/bin/activate && pip install mysqlclient && pip install paho-mqtt
+run ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
+copy run.sh /root/run.sh
+copy loop.sh /root/loop.sh
+run chmod a+x /root/run.sh
+run chmod a+x /root/loop.sh

+ 9 - 0
python/run.bpc.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+echo "PORTA indicata ${PORT}"
+
+cd /home/bpconverter
+. /home/runtime/bin/activate
+
+python manage.py runserver 0.0.0.0:${PORT}
+

+ 9 - 0
python/run.gd.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+echo "PORTA indicata ${PORT}"
+
+cd /home/gd
+. /home/runtime/bin/activate
+
+python manage.py runserver 0.0.0.0:${PORT}
+

+ 9 - 0
python/run.sh

@@ -0,0 +1,9 @@
+#!/bin/bash
+
+echo "PORTA indicata ${PORT}"
+
+cd /home/data/dashboard${V}
+. /home/runtime/bin/activate
+
+python manage.py runserver 0.0.0.0:${PORT}
+

+ 5 - 0
python/start

@@ -0,0 +1,5 @@
+from debian:stable as start
+run echo "Creazione immagine di base"
+run apt update && apt dist-upgrade -y
+run apt install nfs-common -y
+run ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime