diff --git a/Dockerfile b/Dockerfile index 3d9a0030b8f3babc1cc5bae0c2a7e108e5166cff..056f7b8f7eefa37ce6ae0e0e97428df0dadcdd25 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,8 @@ FROM debian:bookworm +# Set the DEBIAN_FRONTEND variable to prevent interactive prompts during package installation. +ARG DEBIAN_FRONTEND=noninteractive + # Install Apache, PHP, and other required extensions # ADDED: sudo and mariadb-client for the entrypoint script RUN apt-get update && apt-get install -y \ @@ -25,6 +28,9 @@ RUN apt-get update && apt-get install -y \ COPY moodle.ini /etc/php/8.2/apache2/conf.d/99-moodle.ini COPY moodle.ini /etc/php/8.2/cli/conf.d/99-moodle.ini +# Set a global ServerName for Apache to suppress the FQDN warning. +RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf + # Download and unpack Moodle ARG MOODLE_VERSION=403 RUN rm -rf /var/www/html diff --git a/docker-compose.yml b/docker-compose.yml index 8c031145f5a80d4cc29a5e12fdfdac8ca9d7583e..8d60c2049dc3568d5f772c3bfdaf0abbe3e92535 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,10 +29,8 @@ services: depends_on: - db restart: unless-stopped - environment: - - MOODLE_WWWROOT= "http://docker:8080" - - MOODLE_ADMIN_USER=user - - MOODLE_ADMIN_PASS=QAYwsx@12345 + env_file: + - .env backend: container_name: backend