diff --git a/.docker/Dockerfile.apache b/.docker/Dockerfile.apache deleted file mode 100644 index f124a85..0000000 --- a/.docker/Dockerfile.apache +++ /dev/null @@ -1,9 +0,0 @@ -# Build apache image -FROM php:7.4-apache -LABEL maintainer="Chris Kankiewicz " - -COPY ./php/config/php.ini /usr/local/etc/php/php.ini -COPY ./apache/config/000-default.conf /etc/apache2/sites-available/000-default.conf - -RUN a2enmod rewrite -RUN pecl install xdebug && docker-php-ext-enable xdebug diff --git a/.docker/Dockerfile.nginx b/.docker/Dockerfile.nginx deleted file mode 100644 index 9f859bf..0000000 --- a/.docker/Dockerfile.nginx +++ /dev/null @@ -1,7 +0,0 @@ -# Build php-fpm image -FROM php:7.4-fpm -LABEL maintainer="Chris Kankiewicz " - -COPY ./php/config/php.ini /usr/local/etc/php/php.ini - -RUN pecl install xdebug && docker-php-ext-enable xdebug diff --git a/.docker/nginx/config/default.conf b/.docker/nginx/config/default.conf deleted file mode 100644 index ca1a51c..0000000 --- a/.docker/nginx/config/default.conf +++ /dev/null @@ -1,30 +0,0 @@ -server { - listen 80 default_server; - root /var/www/html; - index index.php; - - access_log /dev/stderr; - error_log /dev/stderr; - - client_max_body_size 0; - - location = /favicon.ico { access_log off; log_not_found off; } - location = /robots.txt { access_log off; log_not_found off; } - - location / { - try_files $uri $uri/ /index.php$is_args$args; - } - - location ~ \.php { - fastcgi_split_path_info ^(.+\.php)(.*)$; - - fastcgi_param HTTP_PROXY ""; - - fastcgi_pass php-fpm:9000; - fastcgi_index index.php; - - include fastcgi_params; - - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; - } -} diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0ff9ce0 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM php:7.4-apache +LABEL maintainer="Chris Kankiewicz " + +COPY .docker/apache/config/000-default.conf /etc/apache2/sites-available/000-default.conf +COPY .docker/php/config/php.ini /usr/local/etc/php/php.ini + +RUN a2enmod rewrite +RUN pecl install xdebug && docker-php-ext-enable xdebug + +WORKDIR /var/www/html diff --git a/docker-compose.yaml b/docker-compose.yaml index 225bc49..7c66f69 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,32 +1,11 @@ version: '3.4' services: - apache: - container_name: directory-lister-apache - build: - context: .docker - dockerfile: Dockerfile.apache + app: + container_name: directory-lister-app + build: . environment: - VIRTUAL_HOST: directory-lister.local,directory-lister.apache.local - volumes: - - ./:/var/www/html - restart: unless-stopped - - nginx: - container_name: directory-lister-nginx - image: nginx:1.17 - environment: - VIRTUAL_HOST: directory-lister.nginx.local - volumes: - - ./.docker/nginx/config/default.conf:/etc/nginx/conf.d/default.conf - - ./:/var/www/html - restart: unless-stopped - - php-fpm: - container_name: directory-lister-php-fpm - build: - context: .docker - dockerfile: Dockerfile.nginx + VIRTUAL_HOST: directory-lister.local volumes: - ./:/var/www/html restart: unless-stopped