From 9ca109740a447608ebebf91920ebb5e89f0f52ea Mon Sep 17 00:00:00 2001 From: Luca Rullo Date: Thu, 8 Dec 2022 23:23:43 +0100 Subject: [PATCH] Add: Entrypoint and change password edit on entrypoint.sh --- Dockerfile | 19 ++----------------- docker-compose.yml | 8 +++----- entrypoint.sh | 5 +++++ 3 files changed, 10 insertions(+), 22 deletions(-) create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index e737dcb..38ca490 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,5 @@ FROM debian:bullseye-slim -ARG PASSWORD - -ENV PASSWORD $PASSWORD - -RUN echo $PASSWORD - RUN apt update && apt -y upgrade RUN apt -y install apt-transport-https lsb-release ca-certificates curl gnupg && \ @@ -25,19 +19,10 @@ RUN rm -rf /var/www/html/* COPY data/ /var/www/html/ -RUN sed -i "s/1234567890/$PASSWORD/" /var/www/html/inc/conexion.php - RUN chown -R www-data:www-data /var/www/ -#COPY config/default.conf /etc/apache2/sites-available/000-default.conf - -#ENTRYPOINT ["/usr/sbin/apache2", "-k", "start"] - -#ENV APACHE_RUN_USER www-data -#ENV APACHE_RUN_GROUP www-data -#ENV APACHE_LOG_DIR /var/log/apache2 +ADD entrypoint.sh /entrypoint.sh EXPOSE 80 -CMD apachectl -D FOREGROUND - +ENTRYPOINT /entrypoint.sh diff --git a/docker-compose.yml b/docker-compose.yml index b193d21..ff162bb 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,11 +11,9 @@ services: - ./config/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro apache: image: registry.audio-lab.org/loreakazmatzen:1.0 - build: - context: . - dockerfile: Dockerfile - args: - - PASSWORD=${MYSQL_PASSWORD} + environment: + - PASSWORD + build: . ports: - ${APACHE_PORT}:80 diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..91ff0ab --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +sed -i "s/1234567890/$PASSWORD/" /var/www/html/inc/conexion.php + +exec apachectl -D FOREGROUND $@