From fda4c4376e28d3327998ff46b8d3f365f4eb6d39 Mon Sep 17 00:00:00 2001 From: Lukian Date: Tue, 21 Jan 2025 09:02:07 +0100 Subject: [PATCH] Optimize Dockerfile for Apache2 by consolidating installation commands and cleaning up APT lists --- docker/apache2/dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docker/apache2/dockerfile b/docker/apache2/dockerfile index 991eff5..df9b15b 100644 --- a/docker/apache2/dockerfile +++ b/docker/apache2/dockerfile @@ -1,9 +1,7 @@ FROM ubuntu:lastest AS webserver -RUN apt-get update && apt-get install -y apache2 RUN apt-get update && apt-get install -y apache2 openssl ca-certificates \ - && openssl req -nodes -newkey rsa:2048 -sha256 -keyout private-rsa.key -out certifactes.csr - - + && openssl req -nodes -newkey rsa:2048 -sha256 -keyout private-rsa.key -out certifactes.csr \ + rm -rf /var/lib/apt/lists/* WORKDIR /var/www/html COPY ./public/ . CMD ["apache2ctl", "-D", "FOREGROUND"] \ No newline at end of file