Docker is a very fast way to get up and running. This docker setup will make create a fully working app with ngrok and Horizon configured out of the box. I would suggest to add it to your Mailcoach app.
version: '2'
services:
web:
image: nginx
ports:
- '3100:80'
volumes:
- './vhost.conf:/etc/nginx/conf.d/default.conf:ro'
- '.:/var/www/html'
depends_on:
- php
networks:
default:
aliases:
- mailcoach.test
php:
image: napp/php-ci:7.4-fpm
working_dir: /var/www/html
volumes:
- '.:/var/www/html:cached'
environment:
- APP_DEBUG=true
networks:
default:
aliases:
- php.backend
mysql:
image: mysql:8.0
volumes:
- './docker/mysql/docker-entrypoint-initdb.d/:/docker-entrypoint-initdb.d'
command: --default-authentication-plugin=mysql_native_password
restart: always
ports:
- '3306:3306'
environment:
- MYSQL_DATABASE=mailcoach
- MYSQL_USER=mailcoach
- MYSQL_ROOT_PASSWORD=root
- MYSQL_PASSWORD=secret
redis:
image: redis
ports:
- '6379:6379'
horizon:
image: napp/php-ci:7.4-horizon
volumes:
- '.:/var/www/html'
links:
- redis
- mysql
ngrok:
image: shkoliar/ngrok:latest
ports:
- 4551:4551
links:
- web
environment:
- DOMAIN=mailcoach.test
- PORT=80
- REGION=eu
server {
listen 80;
root /var/www/html/public;
index index.html index.htm index.php;
server_name mailcoach.test;
sendfile off;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php.backend:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_read_timeout 300;
}
location ~ /\.ht {
deny all;
}
}