Simplified and reorganized Docker development files

This commit is contained in:
Chris Kankiewicz
2020-02-07 13:46:38 -07:00
parent 8d8ef225c6
commit 25deaa333d
5 changed files with 14 additions and 71 deletions

View File

@@ -1,9 +0,0 @@
# Build apache image
FROM php:7.4-apache
LABEL maintainer="Chris Kankiewicz <Chris@ChrisKankiewicz.com>"
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

View File

@@ -1,7 +0,0 @@
# Build php-fpm image
FROM php:7.4-fpm
LABEL maintainer="Chris Kankiewicz <Chris@ChrisKankiewicz.com>"
COPY ./php/config/php.ini /usr/local/etc/php/php.ini
RUN pecl install xdebug && docker-php-ext-enable xdebug

View File

@@ -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;
}
}

10
Dockerfile Normal file
View File

@@ -0,0 +1,10 @@
FROM php:7.4-apache
LABEL maintainer="Chris Kankiewicz <Chris@ChrisKankiewicz.com>"
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

View File

@@ -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