diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a7b99d3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM php:8.4.14-apache + +# Enable Apache modules and custom config as root during build +RUN a2enmod rewrite + +COPY apache.conf /etc/apache2/conf-available/custom.conf +RUN a2enconf custom + +# Log to /proc/self/fd for container output +RUN sed -i 's|ErrorLog.*|ErrorLog /proc/self/fd/2|' /etc/apache2/sites-available/000-default.conf \ + && sed -i 's|CustomLog.*|CustomLog /proc/self/fd/1 combined|' /etc/apache2/sites-available/000-default.conf \ + && sed -i 's|ErrorLog.*|ErrorLog /proc/self/fd/2|' /etc/apache2/apache2.conf diff --git a/compose.yaml b/compose.yaml index 085bf66..2a31ee8 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,16 +1,11 @@ -version: '3.8' - services: custom: - # image: php:8.3.12-apache - image: php:8.4.14-apache + build: . container_name: stopplidelsen.no working_dir: /var/www/html/ volumes: - ./app:/var/www/app:z - ./content:/var/www/html:z - ./custom:/var/www/custom:z - - ./apache.conf:/etc/apache2/conf-available/custom.conf:z ports: - "4040:80" - command: bash -c "a2enconf custom && a2enmod rewrite && apache2-foreground"