Now stuff is installed in the container instead of the image
This commit is contained in:
@@ -3,12 +3,8 @@ FROM debian:bookworm
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG 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
|
||||
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
|
||||
|
||||
COPY project/entrypoint/entrypoint.sh /entrypoint/entrypoint.sh
|
||||
COPY project/entrypoint/gen-cert.sh /entrypoint/gen-cert.sh
|
||||
#COPY project/entrypoint/install-nginx-mods.sh /entrypoint/install-nginx-mods.sh
|
||||
RUN mkdir /tmp/buildtime && cp /etc/nginx/sites-available/default /tmp/buildtime/default
|
||||
RUN mkdir /tmp/buildtime/www && cp -r /var/www/. /tmp/buildtime/www/
|
||||
RUN mkdir /tmp/buildtime/letsencrypt && cp -r /etc/letsencrypt/. /tmp/buildtime/letsencrypt/
|
||||
ENTRYPOINT ["/bin/sh", "/entrypoint/entrypoint.sh"]
|
||||
|
@@ -2,21 +2,7 @@
|
||||
|
||||
/bin/sh /entrypoint/gen-cert.sh
|
||||
|
||||
for file in /etc/nginx/sites-available/*.conf; do
|
||||
ln -s "$file" "/etc/nginx/sites-enabled/"
|
||||
done
|
||||
|
||||
rm /etc/nginx/sites-enabled/*.conf
|
||||
mv /tmp/buildtime/default /etc/nginx/sites-available/default
|
||||
|
||||
if [ "$(ls -A /etc/letsencrypt)" ]; then
|
||||
mv /tmp/buildtime/letsencrypt/* /etc/letsencrypt
|
||||
fi
|
||||
|
||||
# One-liner with test
|
||||
|
||||
cp -a /tmp/buildtime/www/html* /var/www/html && rm -rf /tmp/buildtime/www/html
|
||||
chown -R www-data:www-data /var/www
|
||||
service nginx start
|
||||
# Run the CMD that was passed (or default)
|
||||
exec "$@"
|
||||
|
||||
tail -f /dev/null
|
||||
|
@@ -5,6 +5,7 @@ mkdir -p /etc/ssl/private
|
||||
chmod 0710 /etc/ssl/private
|
||||
|
||||
# Generate a fresh 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 \
|
||||
|
Reference in New Issue
Block a user