Working docker-compose files for development
This commit is contained in:
parent
2b45b9fd70
commit
5f0db96fc4
@ -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
|
||||
|
2
Makefile
2
Makefile
@ -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
|
||||
|
||||
|
4
Procfile
4
Procfile
@ -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
39
docker-compose.yml
Normal 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
27
docker/nginx/default.conf
Normal 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
3
docker/php/Dockerfile
Normal 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
12
docker/php/www.conf
Normal 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
|
Loading…
Reference in New Issue
Block a user