root 1 miesiąc temu
commit
b7f0551c50
10 zmienionych plików z 196 dodań i 0 usunięć
  1. 0 0
      README.md
  2. 20 0
      apache2/apache2.yml
  3. 15 0
      apache2/directory.patch
  4. 87 0
      docker-compose.yml
  5. 40 0
      php/php.yml
  6. 7 0
      php/run.sh
  7. 6 0
      postfix/postfix.yml
  8. 11 0
      redis/redis.yml
  9. 5 0
      redis/run.sh
  10. 5 0
      start/start.yml

+ 0 - 0
README.md


+ 20 - 0
apache2/apache2.yml

@@ -0,0 +1,20 @@
+FROM postfix
+RUN apt update
+RUN apt install apache2 -y
+RUN apt install patch -y
+RUN echo "IncludeOptional /home/httpd/*/conf/apache2.*.conf" >> /etc/apache2/apache2.conf
+RUN a2enmod ssl
+RUN a2enmod expires
+RUN a2enmod headers
+RUN a2enmod cache
+RUN a2enmod rewrite
+RUN apt-get -y install lsb-release ca-certificates curl
+RUN curl -sSLo /tmp/debsuryorg-archive-keyring.deb https://packages.sury.org/debsuryorg-archive-keyring.deb
+RUN dpkg -i /tmp/debsuryorg-archive-keyring.deb
+RUN sh -c 'echo "deb [signed-by=/usr/share/keyrings/debsuryorg-archive-keyring.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
+RUN apt-get update
+COPY directory.patch /etc/apache2/directory.patch
+RUN patch /etc/apache2/apache2.conf < /etc/apache2/directory.patch
+
+
+

+ 15 - 0
apache2/directory.patch

@@ -0,0 +1,15 @@
+--- apache2.conf	2025-10-07 14:03:17.841952498 +0200
++++ apache2.conf.diff	2025-10-08 15:37:34.332791704 +0200
+@@ -157,9 +157,9 @@
+ # your system is serving content from a sub-directory in /srv you must allow
+ # access here, or in any related virtual host.
+ <Directory />
+-	Options FollowSymLinks
+-	AllowOverride None
+-	Require all denied
++	Options all
++	AllowOverride None
++	Require all Granted
+ </Directory>
+ 
+ <Directory /usr/share>

+ 87 - 0
docker-compose.yml

@@ -0,0 +1,87 @@
+services:
+  start:
+    image: start
+    build:
+      context: start
+      dockerfile: start.yml
+
+  postfix:
+    image: postfix
+    depends_on:
+      - start
+    build:
+      context: postfix
+      dockerfile: postfix.yml
+
+  redis:
+    image: redis
+    depends_on:
+      - start
+    build:
+      context: redis
+      dockerfile: redis.yml
+    entrypoint: ['/bin/bash','/root/run.sh']
+    restart: unless-stopped
+
+  apache2:
+    image: apache2
+    depends_on:
+      - postfix
+    build:
+      context: apache2
+      dockerfile: apache2.yml
+
+  php83-net012:
+    image: php83
+    depends_on:
+      - apache2
+    build:
+      context: php
+      dockerfile: php.yml
+      args:
+        PHP_VERSION: 8.3
+    environment:
+      TZ: Europe/Rome
+    ports:
+      - 10089:80
+      - 10449:443
+    volumes:
+      - net012:/home/httpd
+    entrypoint: ['/bin/bash','/root/run.sh']
+    restart: unless-stopped
+
+  php83-net060:
+    image: php83
+    depends_on:
+      - apache2
+    build:
+      context: php
+      dockerfile: php.yml
+      args:
+        PHP_VERSION: 8.3
+    environment:
+      TZ: Europe/Rome
+    ports:
+      - 11089:80
+      - 11449:443
+    volumes:
+      - net060:/home/httpd
+    entrypoint: ['/bin/bash','/root/run.sh']
+    restart: unless-stopped
+
+volumes:
+  net012:
+    driver: local
+    driver_opts:
+      type: nfs
+      o: "addr=10.132.0.12,soft,rw,noexec,nosuid,nodev"
+      device: ":/home/httpd"
+
+  net060:
+    driver: local
+    driver_opts:
+      type: nfs
+      o: "addr=10.132.0.60,soft,rw,noexec,nosuid,nodev"
+      device: ":/home/httpd"
+
+

+ 40 - 0
php/php.yml

@@ -0,0 +1,40 @@
+ARG PHP_VERSION
+FROM apache2
+ARG PHP_VERSION
+RUN apt update
+RUN apt install -y libapache2-mod-php${PHP_VERSION}
+RUN apt install -y php${PHP_VERSION}
+RUN apt install -y php${PHP_VERSION}-apcu
+RUN apt install -y php${PHP_VERSION}-cli
+RUN apt install -y php${PHP_VERSION}-common
+RUN apt install -y php${PHP_VERSION}-curl 
+RUN apt install -y php${PHP_VERSION}-bz2
+RUN apt install -y php${PHP_VERSION}-gd  
+RUN apt install -y php${PHP_VERSION}-igbinary
+RUN apt install -y php${PHP_VERSION}-imagick
+RUN apt install -y php${PHP_VERSION}-imap  
+RUN apt install -y php${PHP_VERSION}-intl 
+RUN apt install -y php${PHP_VERSION}-mbstring
+RUN apt install -y php${PHP_VERSION}-memcache
+RUN apt install -y php${PHP_VERSION}-memcached
+RUN apt install -y php${PHP_VERSION}-msgpack 
+RUN apt install -y php${PHP_VERSION}-mysql  
+RUN apt install -y php${PHP_VERSION}-opcache
+RUN apt install -y php${PHP_VERSION}-pspell
+RUN apt install -y php${PHP_VERSION}-readline
+RUN apt install -y php${PHP_VERSION}-redis  
+RUN apt install -y php${PHP_VERSION}-soap  
+RUN apt install -y php${PHP_VERSION}-tidy 
+RUN apt install -y php${PHP_VERSION}-xml 
+RUN apt install -y php${PHP_VERSION}-xmlrpc
+RUN apt install -y php${PHP_VERSION}-xsl 
+RUN apt install -y php${PHP_VERSION}-zip
+RUN apt install -y php${PHP_VERSION}-bcmath
+RUN apt install -y php${PHP_VERSION}-sqlite3
+RUN apt install -y composer
+RUN echo "ServerName \"${PHP_VERSION}\"" >> /etc/apache2/apache2.conf
+RUN sed -i -e "s/upload_max_filesize = 2M/upload_max_filesize = 100M/g" /etc/php/${PHP_VERSION}/apache2/php.ini
+COPY run.sh /root
+RUN chmod a+x /root/run.sh
+CMD ['/bin/bash','/root/run.sh']
+

+ 7 - 0
php/run.sh

@@ -0,0 +1,7 @@
+#!/bin/bash
+/etc/init.d/postfix start
+echo "macchina in partenza" | mail -s "macchina in partenza" server@altemica.net
+/etc/init.d/apache2 start
+touch /tmp/null
+tail -f /tmp/null
+

+ 6 - 0
postfix/postfix.yml

@@ -0,0 +1,6 @@
+FROM start
+RUN apt update
+RUN apt install bsd-mailx postfix -y
+RUN echo "root: server@altemica.net" >> /etc/aliases
+RUN echo newaliases
+RUN postconf relayhost=[10.132.0.8]

+ 11 - 0
redis/redis.yml

@@ -0,0 +1,11 @@
+FROM postfix
+RUN apt update
+RUN apt install -y redis
+#RUN echo "bind 127.0.0.1 0.0.0.0 ::1" >> /etc/redis/redis.conf
+RUN echo "bind 0.0.0.0" >> /etc/redis/redis.conf
+RUN sed -e 's/protected-mode yes/protected-mode no/g' -i /etc/redis/redis.conf
+RUN mkdir /var/log/redis -p
+RUN chown redis:redis /var/log/redis
+COPY run.sh /root
+RUN chmod a+x /root/run.sh
+CMD ['/bin/bash','/root/run.sh']

+ 5 - 0
redis/run.sh

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

+ 5 - 0
start/start.yml

@@ -0,0 +1,5 @@
+FROM debian:stable AS start
+RUN echo "Creazione immagine di base"
+RUN apt update && apt dist-upgrade -y
+RUN ln -sf /usr/share/zoneinfo/Europe/Rome /etc/localtime
+