Add: Entrypoint and change password edit on entrypoint.sh

This commit is contained in:
Luca 2022-12-08 23:23:43 +01:00
parent a7ce35dcd0
commit 9ca109740a
3 changed files with 10 additions and 22 deletions

View File

@ -1,11 +1,5 @@
FROM debian:bullseye-slim FROM debian:bullseye-slim
ARG PASSWORD
ENV PASSWORD $PASSWORD
RUN echo $PASSWORD
RUN apt update && apt -y upgrade RUN apt update && apt -y upgrade
RUN apt -y install apt-transport-https lsb-release ca-certificates curl gnupg && \ 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/ 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/ RUN chown -R www-data:www-data /var/www/
#COPY config/default.conf /etc/apache2/sites-available/000-default.conf ADD entrypoint.sh /entrypoint.sh
#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
EXPOSE 80 EXPOSE 80
CMD apachectl -D FOREGROUND ENTRYPOINT /entrypoint.sh

View File

@ -11,11 +11,9 @@ services:
- ./config/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro - ./config/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro
apache: apache:
image: registry.audio-lab.org/loreakazmatzen:1.0 image: registry.audio-lab.org/loreakazmatzen:1.0
build: environment:
context: . - PASSWORD
dockerfile: Dockerfile build: .
args:
- PASSWORD=${MYSQL_PASSWORD}
ports: ports:
- ${APACHE_PORT}:80 - ${APACHE_PORT}:80

5
entrypoint.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
sed -i "s/1234567890/$PASSWORD/" /var/www/html/inc/conexion.php
exec apachectl -D FOREGROUND $@