A bunch of things

This commit is contained in:
eroncero
2025-08-15 19:11:21 +02:00
parent 89e2780710
commit 1270dad444
16 changed files with 35 additions and 12 deletions

9
2do.txt Normal file
View File

@@ -0,0 +1,9 @@
- Install certbot in the container instead of the image (download only in the image). It should be like this, since /etc/letsencrypt should be added as a volume. I assume it might break apt install certbot in a new docker compose up -d.
- Copy php-fpm pools from host to /etc/php/8.2/fpm/pool.d
- Instead of apt-get update, just apt-get install (because packages are already downloaded).
- Code refactor.

View File

@@ -3,8 +3,8 @@
sudo rm -rfv nginx-srv/etc
sudo rm -rfv nginx-srv/var
sudo rm -rfv multi-php-fpm/etc
sudo rm -rfv multi-php-fpm/run
sudo rm -rfv multi-php-fpm-srv/etc
sudo rm -rfv multi-php-fpm-srv/run
sudo rm -rfv mariadb-srv/run
sudo rm -rfv mariadb-srv/var

View File

@@ -15,20 +15,20 @@ services:
- ./nginx-srv/etc/nginx/sites-available:/etc/nginx/sites-available # Server blocks aka virtual hosts.
- ./nginx-srv/var/www:/var/www # Webpage public html.
- ./nginx-srv/etc/letsencrypt:/etc/letsencrypt
- ./multi-php-fpm/run/php:/run/php # Socket files dir. It will be mounted and shared from the PHP container.
- ./multi-php-fpm-srv/run/php:/run/php # Socket files dir. It will be mounted and shared from the PHP container.
multi-php-fpm:
image: eroncero/multi-php-fpm:latest
multi-php-fpm-srv:
image: eroncero/multi-php-fpm-srv:latest
build:
context: ./multi-php-fpm
context: ./multi-php-fpm-srv
dockerfile: Dockerfile
restart: unless-stopped
hostname: multi-php-fpm
hostname: multi-php-fpm-srv
environment:
- PHP_VERSIONS=${PHP_VERSIONS} # Inherits from .env
volumes:
- ./multi-php-fpm/etc/php:/etc/php
- ./multi-php-fpm/run/php:/run/php
- ./multi-php-fpm-srv/etc/php:/etc/php
- ./multi-php-fpm-srv/run/php:/run/php
- ./mariadb-srv/run/mysql:/run/mysqld # php-mysql should be able connecting to the MariaDB socket.
mariadb-srv:

View File

@@ -3,8 +3,9 @@ FROM debian:bookworm
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true
RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y; apt-get install mariadb-server mariadb-client iputils-ping -y --download-only
RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y; apt-get install iputils-ping -y; apt-get install mariadb-server mariadb-client -y --download-only
COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh
COPY project/entrypoint/install-packages.sh /entrypoint/install-packages.sh
ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"]

View File

@@ -2,6 +2,13 @@
service mariadb start
chown -R mysql:mysql /run/mysql
chown -R mysql:mysql /var/lib/mysql
/bin/sh /entrypoint/install-packages.sh
service mariadb start
# Run the CMD that was passed (or default)
exec "$@"

View File

@@ -0,0 +1,3 @@
#!/bin/sh
apt-get update; apt-get full-upgrade -y; apt-get install mariadb-server mariadb-client -y

View File

@@ -2,6 +2,7 @@ FROM debian:bookworm
ENV DEBIAN_FRONTEND=noninteractive
ENV DEBCONF_NONINTERACTIVE_SEEN=true
RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y && apt-get install iputils-ping -y
COPY project/buildtime/sury-repo.sh /tmp/buildtime/sury-repo.sh

View File

@@ -2,6 +2,7 @@
/bin/sh /entrypoint/container-php-ver-inst.sh
/bin/sh /entrypoint/install-php-versions.sh
/bin/sh /entrypoint/start-php-fpm.sh
# Run the CMD that was passed (or default)
exec "$@"

View File

@@ -74,5 +74,3 @@ if ! update-alternatives --set php "/usr/bin/php${DEF_PHP_INTERPRETER}"; then
exit 1
fi
# Start PHP-FPM services
exec /bin/sh /entrypoint/start-php-fpm.sh

View File

@@ -1,6 +1,9 @@
#!/bin/sh
apt-get update; apt-get full-upgrade -y; apt-get install nginx certbot python3-certbot-nginx openssl vim curl iputils-ping -y; apt-get autoclean -y
/bin/sh /entrypoint/gen-cert.sh
service nginx start
# Run the CMD that was passed (or default)
exec "$@"