From e8ee6ecc3a922eeb08a1c37cbac4b220856dbd4f Mon Sep 17 00:00:00 2001 From: ycharbi Date: Mon, 15 Aug 2022 12:38:14 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20du=20support=20HTTPS=20+=20support=20de?= =?UTF-8?q?=20l'ex=C3=A9cution=20du=20script=20rundocker.sh=20depuis=20n'i?= =?UTF-8?q?mporte=20quel=20r=C3=A9pertoire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 9 ++++++--- outils/rundocker.sh | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 859132c..5fad0fb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ -FROM debian:testing -RUN apt update -y && apt install -y --no-install-recommends apache2 php libapache2-mod-php sqlite3 php-sqlite3 && \ +FROM debian:11 +RUN apt update -y && apt install -y --no-install-recommends openssl apache2 php libapache2-mod-php sqlite3 php-sqlite3 && \ apt clean && \ rm -rf /var/lib/apt/lists/* && \ mkdir -p /etc/postfix/ && \ -rm /var/www/html/index.html +rm /var/www/html/index.html && \ +openssl req -x509 -nodes -days 5000 -newkey rsa:4096 -out /etc/ssl/certs/ssl-cert-snakeoil.pem -keyout /etc/ssl/private/ssl-cert-snakeoil.key -subj "/C=FR/ST=Paris/L=Paris/O=Courtail/OU=Courtail/CN=127.0.0.1" && \ +a2enmod ssl && \ +a2ensite default-ssl.conf COPY . /var/www/html/ RUN mv /var/www/html/outils/conf/php.ini /etc/php/7.4/apache2 && \ mv /var/www/html/outils/conf/apache2.conf /etc/apache2/ && \ diff --git a/outils/rundocker.sh b/outils/rundocker.sh index dab684a..c36a413 100755 --- a/outils/rundocker.sh +++ b/outils/rundocker.sh @@ -1,3 +1,5 @@ #!/bin/sh -docker build -t courtail ../ -docker run -it -p 8080:80 courtail:latest + +dockerfile="$(dirname ${0})/../" +docker build -t courtail "${dockerfile}" +docker run -it -p 8080:80 -p 4443:443 courtail:latest \ No newline at end of file