Compare commits

..

2 Commits

Author SHA1 Message Date
eroncero
29aa1f2d40 General fixes 2025-08-18 16:33:16 +02:00
eroncero
69b7243685 General refactor and fix 2025-08-18 16:10:38 +02:00
13 changed files with 49 additions and 22 deletions

View File

@ -13,7 +13,7 @@ services:
hostname: nginx-srv hostname: nginx-srv
volumes: volumes:
- ./mnt/place-config/etc/nginx:/mnt/place-config/etc/nginx # Config ready to be copied into the container. - ./mnt/place-config/etc/nginx:/mnt/place-config/etc/nginx # Config ready to be copied into the container.
- ./nginx-srv/var/www:/var/www # Webpage public html. - ./nginx-srv/www:/var/www # Webpage public html.
- ./nginx-srv/etc/letsencrypt:/etc/letsencrypt - ./nginx-srv/etc/letsencrypt:/etc/letsencrypt
- ./multi-php-fpm-srv/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.

View File

@ -3,7 +3,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; apt-get install mariadb-server mariadb-client -y --download-only RUN apt-get update; apt-get full-upgrade -y; apt-get install iputils-ping -y; apt-get autoclean -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 COPY project/entrypoint/install-packages.sh /entrypoint/install-packages.sh

View File

@ -1,12 +1,10 @@
#!/bin/sh #!/bin/sh
service mariadb start
chown -R mysql:mysql /run/mysql
chown -R mysql:mysql /var/lib/mysql
/bin/sh /entrypoint/install-packages.sh /bin/sh /entrypoint/install-packages.sh
chown -R mysql:mysql /run/mysqld
chown -R mysql:mysql /var/lib/mysql
service mariadb start service mariadb start
# Run the CMD that was passed (or default) # Run the CMD that was passed (or default)

View File

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

View File

@ -3,7 +3,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 install vim curl iputils-ping -y; apt-get autoclean -y
COPY project/buildtime/sury-repo.sh /tmp/buildtime/sury-repo.sh COPY project/buildtime/sury-repo.sh /tmp/buildtime/sury-repo.sh
RUN /bin/sh /tmp/buildtime/sury-repo.sh RUN /bin/sh /tmp/buildtime/sury-repo.sh
@ -12,9 +12,9 @@ ENV BUILDTIME_PHP_VER_INST="8.2"
COPY project/buildtime/buildtime_php_ver_inst.sh /tmp/buildtime/buildtime_php_ver_inst.sh COPY project/buildtime/buildtime_php_ver_inst.sh /tmp/buildtime/buildtime_php_ver_inst.sh
RUN /bin/sh /tmp/buildtime/buildtime_php_ver_inst.sh RUN /bin/sh /tmp/buildtime/buildtime_php_ver_inst.sh
ENV DEF_PHP_INTERPRETER="8.2" ENV DEF_PHP_INTERPRETER="8.2"
ENV PHP_VERSIONS=
COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh
COPY project/entrypoint/copy-config.sh /entrypoint/copy-config.sh
COPY project/entrypoint/container-php-ver-inst.sh /entrypoint/container-php-ver-inst.sh COPY project/entrypoint/container-php-ver-inst.sh /entrypoint/container-php-ver-inst.sh
COPY project/entrypoint/install-php-versions.sh /entrypoint/install-php-versions.sh COPY project/entrypoint/install-php-versions.sh /entrypoint/install-php-versions.sh
COPY project/entrypoint/start-php-fpm.sh /entrypoint/start-php-fpm.sh COPY project/entrypoint/start-php-fpm.sh /entrypoint/start-php-fpm.sh

View File

@ -0,0 +1,4 @@
#!/bin/sh
# Copy all .conf files from source to destination
cp /mnt/place-config/etc/php/8.2/fpm/pool.d/*.conf /etc/php/8.2/fpm/pool.d/

View File

@ -2,6 +2,8 @@
/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/copy-config.sh
/bin/sh /entrypoint/start-php-fpm.sh /bin/sh /entrypoint/start-php-fpm.sh
# Run the CMD that was passed (or default) # Run the CMD that was passed (or default)

View File

@ -1,10 +1,11 @@
FROM debian:bookworm FROM debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive
ARG 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 nginx certbot python3-certbot-nginx openssl vim curl iputils-ping -y --download-only RUN apt-get update; apt-get full-upgrade -y; apt-get autoclean -y; apt-get install -y vim curl iputils-ping; apt-get install -y nginx certbot python3-certbot-nginx openssl --download-only
COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh
COPY project/entrypoint/copy-config.sh /entrypoint/copy-config.sh
COPY project/entrypoint/gen-cert.sh /entrypoint/gen-cert.sh COPY project/entrypoint/gen-cert.sh /entrypoint/gen-cert.sh
ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"] ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"]

View File

@ -0,0 +1,4 @@
#!/bin/sh
# Copy all .conf files from source to destination
cp /mnt/place-config/etc/nginx/sites-available/*.conf /etc/nginx/sites-available/

View File

@ -1,4 +0,0 @@
#!/bin/sh
# /mnt/place-config will be mounted/defined in docker-compose.yaml
cp -r /mnt/place-config/etc/nginx/sites-available /etc/nginx/sites-available

View File

@ -1,8 +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 apt-get install -y nginx certbot python3-certbot-nginx openssl; apt-get autoclean -y
/bin/sh /entrypoint/gen-cert.sh /bin/sh /entrypoint/gen-cert.sh
/bin/sh /entrypoint/copy-config.sh
service nginx start service nginx start
# Run the CMD that was passed (or default) # Run the CMD that was passed (or default)

View File

@ -4,11 +4,9 @@ mkdir -p /etc/ssl/certs
mkdir -p /etc/ssl/private mkdir -p /etc/ssl/private
chmod 0710 /etc/ssl/private chmod 0710 /etc/ssl/private
# Generate a fresh cert every time # Generate a fresh self-signed cert every time
apt-get install -y openssl apt-get install -y openssl
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \ openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
-keyout /etc/ssl/private/ssl-cert-snakeoil.key \ -keyout /etc/ssl/private/ssl-cert-snakeoil.key \
-out /etc/ssl/certs/ssl-cert-snakeoil.pem \ -out /etc/ssl/certs/ssl-cert-snakeoil.pem \
-subj "/C=US/ST=Exam" -subj "/C=ES/ST=Exam"
echo "Generated self-signed cert:"

View File

@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>Welcome to nginx!</h1>
<p>If you see this page, the nginx web server is successfully installed and
working. Further configuration is required.</p>
<p>For online documentation and support please refer to
<a href="http://nginx.org/">nginx.org</a>.<br/>
Commercial support is available at
<a href="http://nginx.com/">nginx.com</a>.</p>
<p><em>Thank you for using nginx.</em></p>
</body>
</html>