General refactor and fix
This commit is contained in:
@@ -13,7 +13,7 @@ services:
|
||||
hostname: nginx-srv
|
||||
volumes:
|
||||
- ./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
|
||||
- ./multi-php-fpm-srv/run/php:/run/php # Socket files dir. It will be mounted and shared from the PHP container.
|
||||
|
||||
|
@@ -3,7 +3,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; 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/install-packages.sh /entrypoint/install-packages.sh
|
||||
|
@@ -1,7 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
service mariadb start
|
||||
|
||||
chown -R mysql:mysql /run/mysql
|
||||
chown -R mysql:mysql /var/lib/mysql
|
||||
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#!/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
|
||||
|
@@ -3,7 +3,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
|
||||
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
|
||||
RUN /bin/sh /tmp/buildtime/sury-repo.sh
|
||||
@@ -12,7 +12,6 @@ ENV BUILDTIME_PHP_VER_INST="8.2"
|
||||
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
|
||||
ENV DEF_PHP_INTERPRETER="8.2"
|
||||
ENV PHP_VERSIONS=
|
||||
|
||||
COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh
|
||||
COPY project/entrypoint/container-php-ver-inst.sh /entrypoint/container-php-ver-inst.sh
|
||||
|
@@ -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)
|
||||
|
@@ -1,10 +1,11 @@
|
||||
FROM debian:bookworm
|
||||
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG DEBCONF_NONINTERACTIVE_SEEN=true
|
||||
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 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/copy-config.sh /entrypoint/copy-config.sh
|
||||
COPY project/entrypoint/gen-cert.sh /entrypoint/gen-cert.sh
|
||||
ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"]
|
||||
|
4
nginx-srv/project/entrypoint/copy-config.sh
Normal file
4
nginx-srv/project/entrypoint/copy-config.sh
Normal 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/
|
@@ -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
|
@@ -1,8 +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
|
||||
apt-get install -y nginx certbot python3-certbot-nginx openssl; apt-get autoclean -y
|
||||
|
||||
/bin/sh /entrypoint/gen-cert.sh
|
||||
/bin/sh /entrypoint/copy-config.sh
|
||||
service nginx start
|
||||
|
||||
# Run the CMD that was passed (or default)
|
||||
|
@@ -4,11 +4,9 @@ mkdir -p /etc/ssl/certs
|
||||
mkdir -p /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
|
||||
openssl req -x509 -newkey rsa:4096 -sha256 -days 3650 -nodes \
|
||||
-keyout /etc/ssl/private/ssl-cert-snakeoil.key \
|
||||
-out /etc/ssl/certs/ssl-cert-snakeoil.pem \
|
||||
-subj "/C=US/ST=Exam"
|
||||
|
||||
echo "Generated self-signed cert:"
|
||||
-subj "/C=ES/ST=Exam"
|
||||
|
Reference in New Issue
Block a user