A bunch of things
This commit is contained in:
9
2do.txt
Normal file
9
2do.txt
Normal 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.
|
||||||
|
|
||||||
|
|
@@ -3,8 +3,8 @@
|
|||||||
sudo rm -rfv nginx-srv/etc
|
sudo rm -rfv nginx-srv/etc
|
||||||
sudo rm -rfv nginx-srv/var
|
sudo rm -rfv nginx-srv/var
|
||||||
|
|
||||||
sudo rm -rfv multi-php-fpm/etc
|
sudo rm -rfv multi-php-fpm-srv/etc
|
||||||
sudo rm -rfv multi-php-fpm/run
|
sudo rm -rfv multi-php-fpm-srv/run
|
||||||
|
|
||||||
sudo rm -rfv mariadb-srv/run
|
sudo rm -rfv mariadb-srv/run
|
||||||
sudo rm -rfv mariadb-srv/var
|
sudo rm -rfv mariadb-srv/var
|
||||||
|
@@ -15,20 +15,20 @@ services:
|
|||||||
- ./nginx-srv/etc/nginx/sites-available:/etc/nginx/sites-available # Server blocks aka virtual hosts.
|
- ./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/var/www:/var/www # Webpage public html.
|
||||||
- ./nginx-srv/etc/letsencrypt:/etc/letsencrypt
|
- ./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:
|
multi-php-fpm-srv:
|
||||||
image: eroncero/multi-php-fpm:latest
|
image: eroncero/multi-php-fpm-srv:latest
|
||||||
build:
|
build:
|
||||||
context: ./multi-php-fpm
|
context: ./multi-php-fpm-srv
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
hostname: multi-php-fpm
|
hostname: multi-php-fpm-srv
|
||||||
environment:
|
environment:
|
||||||
- PHP_VERSIONS=${PHP_VERSIONS} # Inherits from .env
|
- PHP_VERSIONS=${PHP_VERSIONS} # Inherits from .env
|
||||||
volumes:
|
volumes:
|
||||||
- ./multi-php-fpm/etc/php:/etc/php
|
- ./multi-php-fpm-srv/etc/php:/etc/php
|
||||||
- ./multi-php-fpm/run/php:/run/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/run/mysql:/run/mysqld # php-mysql should be able connecting to the MariaDB socket.
|
||||||
|
|
||||||
mariadb-srv:
|
mariadb-srv:
|
||||||
|
@@ -3,8 +3,9 @@ FROM debian:bookworm
|
|||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV DEBCONF_NONINTERACTIVE_SEEN=true
|
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/entrypoint.sh /entrypoint/entrypoint.sh
|
||||||
|
COPY project/entrypoint/install-packages.sh /entrypoint/install-packages.sh
|
||||||
|
|
||||||
ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"]
|
ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"]
|
||||||
|
@@ -2,6 +2,13 @@
|
|||||||
|
|
||||||
service mariadb start
|
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)
|
# Run the CMD that was passed (or default)
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
|
||||||
|
3
mariadb-srv/project/entrypoint/install-packages.sh
Normal file
3
mariadb-srv/project/entrypoint/install-packages.sh
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
apt-get update; apt-get full-upgrade -y; apt-get install mariadb-server mariadb-client -y
|
@@ -2,6 +2,7 @@ FROM debian:bookworm
|
|||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV DEBCONF_NONINTERACTIVE_SEEN=true
|
ENV DEBCONF_NONINTERACTIVE_SEEN=true
|
||||||
|
|
||||||
RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y && apt-get install iputils-ping -y
|
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
|
COPY project/buildtime/sury-repo.sh /tmp/buildtime/sury-repo.sh
|
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
/bin/sh /entrypoint/container-php-ver-inst.sh
|
/bin/sh /entrypoint/container-php-ver-inst.sh
|
||||||
/bin/sh /entrypoint/install-php-versions.sh
|
/bin/sh /entrypoint/install-php-versions.sh
|
||||||
|
/bin/sh /entrypoint/start-php-fpm.sh
|
||||||
|
|
||||||
# Run the CMD that was passed (or default)
|
# Run the CMD that was passed (or default)
|
||||||
exec "$@"
|
exec "$@"
|
@@ -74,5 +74,3 @@ if ! update-alternatives --set php "/usr/bin/php${DEF_PHP_INTERPRETER}"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Start PHP-FPM services
|
|
||||||
exec /bin/sh /entrypoint/start-php-fpm.sh
|
|
@@ -1,6 +1,9 @@
|
|||||||
#!/bin/sh
|
#!/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
|
/bin/sh /entrypoint/gen-cert.sh
|
||||||
|
service nginx start
|
||||||
|
|
||||||
# Run the CMD that was passed (or default)
|
# Run the CMD that was passed (or default)
|
||||||
exec "$@"
|
exec "$@"
|
||||||
|
Reference in New Issue
Block a user