Working docker-compose files for development

This commit is contained in:
Nabeel Shahzad 2019-05-10 18:40:07 -05:00
parent 2b45b9fd70
commit 5f0db96fc4
8 changed files with 87 additions and 4 deletions

View File

@ -55,6 +55,7 @@ if [ "$TRAVIS" = "true" ]; then
.sass-cache
.idea
.travis
docker
tests
_ide_helper.php
.dpl
@ -64,6 +65,7 @@ if [ "$TRAVIS" = "true" ]; then
.styleci.yml
env.php
config.php
docker-compose.yml
Makefile
phpunit.xml
phpvms.iml

View File

@ -52,7 +52,7 @@ update: build
@echo "Done!"
.PHONY: reset
reset: cleanapp/Models/Traits/JournalTrait.php
reset: clean
@php $(COMPOSER) dump-autoload
@make reload-db

View File

@ -1,5 +1,5 @@
dnsmasq: /usr/local/sbin/dnsmasq --keep-in-foreground
#dnsmasq: /usr/local/sbin/dnsmasq --keep-in-foreground
php-fpm: /usr/local/sbin/php-fpm --nodaemonize
nginx: /usr/local/bin/nginx -g 'daemon off;'
#mysql: /usr/local/bin/mysqld
mysql: docker-compose --file ~/docker/mysql/docker-compose.yml up
#mailhog: /usr/local/bin/mailhog

39
docker-compose.yml Normal file
View File

@ -0,0 +1,39 @@
---
version: '3'
services:
app:
build:
context: ./docker/php
environment:
DB_HOST: mysql
volumes:
- ./:/var/www
- ./docker/php/www.conf:/usr/local/etc/php-fpm.d/www.conf
depends_on:
- mysql
nginx:
image: nginx:1.13.8
command: /bin/bash -c "exec nginx -g 'daemon off;'"
volumes:
- ./:/var/www
- ./docker/nginx/default.conf:/etc/nginx/conf.d/default.conf
ports:
- 80:80
depends_on:
- app
mysql:
image: mysql:5.7.26
environment:
- MYSQL_DATABASE=phpvms
- MYSQL_ROOT_PASSWORD=
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
volumes:
- mysql-data:/var/lib/mysql
ports:
- 3306
volumes:
mysql-data:

27
docker/nginx/default.conf Normal file
View File

@ -0,0 +1,27 @@
server {
listen 80 default_server;
server_name phpvms.test;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /var/www/public;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}

3
docker/php/Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM php:7.3-fpm
RUN docker-php-ext-install mysqli pdo openssl mbstring tokenizer curl json gmp

12
docker/php/www.conf Normal file
View File

@ -0,0 +1,12 @@
[www]
user = www-data
group = www-data
listen = :9000
pm = dynamic
pm.max_children = 5
pm.start_servers = 2
pm.min_spare_servers = 1
pm.max_spare_servers = 3

View File

@ -1,7 +1,7 @@
<?php
/**
* phpVMS
* phpVMS (root folder)
*/
$path_to_phpvms_folder = __DIR__;