General refactor and fix
This commit is contained in:
@@ -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