All Projects → dambrogia → Docker Testing

dambrogia / Docker Testing

Projects that are alternatives of or similar to Docker Testing

Config
Armbian configuration utility
Stars: ✭ 317 (+1661.11%)
Mutual labels:  mysql, nginx, apache
Netkiller.github.io
Netkiller Free ebook - 免费电子书
Stars: ✭ 861 (+4683.33%)
Mutual labels:  mysql, nginx, apache
Ezhttp
The bash shell script stack for installation of Nginx OpenResty Tengine lua_nginx_module nginx_concat_module nginx_upload_module ngx_substitutions_filter_module Apache-2.2 Apache-2.4 MySQL-5.1 MySQL-5.5 MySQL-5.6 MySQL-5.7 PHP-5.2 PHP-5.3 PHP-5.4 PHP-5.5 PHP-5.6 ZendOptimizer ZendGuardLoader Xcache Eaccelerator Imagemagick IonCube Memcache Memcached Redis Mongo Xdebug Mssql Memcached PureFtpd PhpMyAdmin Redis Mongodb PhpRedisAdmin MemAdmin RockMongo Jdk7 Jdk8 Tomcat7 Tomcat8
Stars: ✭ 443 (+2361.11%)
Mutual labels:  mysql, nginx, apache
Dockerweb
A docker-powered bash script for shared web hosting management. The ultimate Docker LAMP/LEMP Stack.
Stars: ✭ 89 (+394.44%)
Mutual labels:  mysql, nginx, apache
Developer
Gameserver, Voiceserver, Rootserver Webinterface
Stars: ✭ 161 (+794.44%)
Mutual labels:  mysql, nginx, apache
Owasp Mth3l3m3nt Framework
OWASP Mth3l3m3nt Framework is a penetration testing aiding tool and exploitation framework. It fosters a principle of attack the web using the web as well as pentest on the go through its responsive interface.
Stars: ✭ 139 (+672.22%)
Mutual labels:  mysql, nginx, apache
Docs4dev
后端开发常用框架文档及中文翻译,包含 Spring 系列文档(Spring, Spring Boot, Spring Cloud, Spring Security, Spring Session),大数据(Apache Hive, HBase, Apache Flume),日志(Log4j2, Logback),Http Server(NGINX,Apache),Python,数据库(OpenTSDB,MySQL,PostgreSQL)等最新官方文档以及对应的中文翻译。
Stars: ✭ 974 (+5311.11%)
Mutual labels:  mysql, nginx, apache
Guacamole Install Rhel 7
Apache Guacamole installation bash script for RHEL 7 and CentOS 7 including options for Nginx, HTTPS, SSL, LDAP, Let's Encrypt certificates and more
Stars: ✭ 174 (+866.67%)
Mutual labels:  mysql, nginx, apache
Devilbox
A modern Docker LAMP stack and MEAN stack for local development
Stars: ✭ 3,598 (+19888.89%)
Mutual labels:  mysql, nginx, apache
Docker Laravel
🐳 Build a simple laravel development environment with docker-compose.
Stars: ✭ 415 (+2205.56%)
Mutual labels:  mysql, nginx
Vue2 blog
使用vue2.x + vue-cli +vue-router+ vuex + axios + mysql + express + pm2 + webpack+nginx构建的具有登录,注册,留言,用户发帖,用户评论等功能的SPA Blog。注意,注意,注意,后端API全部自己手写,很适合刚学习vue以及express的小伙伴学习,喜欢请Star鼓励一下我,谢谢!项目预览:
Stars: ✭ 417 (+2216.67%)
Mutual labels:  mysql, nginx
Ansible Playbooks
Ansible playbook collection that have been written for Ubuntu. Some of the playbooks are Elasticsearch, Mesos, AWS, MySql, Sensu, Nginx etc..
Stars: ✭ 429 (+2283.33%)
Mutual labels:  mysql, nginx
Shell
Infrastructure Management Shell - Linux
Stars: ✭ 381 (+2016.67%)
Mutual labels:  mysql, nginx
Notebook
🍎 笔记本
Stars: ✭ 381 (+2016.67%)
Mutual labels:  mysql, nginx
Full Stack Notes
全栈工程师手册
Stars: ✭ 366 (+1933.33%)
Mutual labels:  mysql, nginx
H5ai
HTTP web server index for Apache httpd, lighttpd and nginx.
Stars: ✭ 4,650 (+25733.33%)
Mutual labels:  nginx, apache
Vagrant Php Dev Box
PHP 7 vagrant development box with nginx, php-fpm, MySQL, Symfony, Laravel, ... on Ubuntu 16.04
Stars: ✭ 473 (+2527.78%)
Mutual labels:  mysql, nginx
Salamanderwnmp
A beautiful Nginx PHP Mysql environment for windows( windows下用WPF制作的nginx,php,mysql集成环境(免安装))
Stars: ✭ 358 (+1888.89%)
Mutual labels:  mysql, nginx
Modsecurity
ModSecurity is an open source, cross platform web application firewall (WAF) engine for Apache, IIS and Nginx that is developed by Trustwave's SpiderLabs. It has a robust event-based programming language which provides protection from a range of attacks against web applications and allows for HTTP traffic monitoring, logging and real-time analys…
Stars: ✭ 5,015 (+27761.11%)
Mutual labels:  nginx, apache
Php Docker Boilerplate
🍲 PHP Docker Boilerplate for Symfony, Wordpress, Joomla or any other PHP Project (NGINX, Apache HTTPd, PHP-FPM, MySQL, Solr, Elasticsearch, Redis, FTP)
Stars: ✭ 503 (+2694.44%)
Mutual labels:  mysql, nginx

Preface:

I had posted a stack overflow question and there seemed to be little documentation or explanation about how this separation of power works. I've decided to document this for future reference.

See my question here

Docker Testing

This is a very small proof of concept for running a docker environment.

This test environment contains the following separate containers working together:

  • php:7.4-fpm-alpine
  • httpd:2.4-alpine
  • mysql:5.6

There is also an nginx section commented out in the docker-compose file that can be interchanged with apache.

For more info please see docker-compose.yml

To get started

git clone https://github.com/dambrogia/docker-testing.git
cd docker-testing
docker-compose up -d

Please wait up to 60 seconds for the MySQL service to be available to connect to! Until then you may run into the following error:

Warning: mysqli::__construct(): (HY000/2002): Connection refused in /var/www/html/index.php on line 14
Connect failed: Connection refused

After MySQL is ready, visit 127.0.0.1:8000 in your browser. You should see a the output from public_html/index.php.

Problems and their resolutions

Apache

First and foremost, the biggest problem was getting apache to run PHP files rather than display their source code. Because Apache and PHP are running in separate containers we couldn't simply have apache call PHP to render the files.

The answer to this was to to use PHP FPM which will accept incoming requests. We proxy our Apache requests to PHP FPM. You can find this direct setting here.

I found out this was possible in nginx first - docs here

And then I applied what I found in nginx to Apache through some help here.

PHP

After being able to run PHP files through apache the next error I ran into was that I was missing the MySQL extension for PHP. Because we're using lightweight alpine linux distros, we can't simply add php extensions through yum or apt or event apk (alpines package manager). After a while of googling my fingers off I found out that docker has a solution for this. You can see it in action here, and that link also includes commentary to where I stumbled across the solution.

MySQL

Finally, now that I can run MySQL functions in PHP. Of course I run into my last problem - the good ol' connection refused error. I knew that my credentials were valid because through port forwarding I could connect with a MySQL GUI. I googled my fingers off for a few minutes and came across a networking concept within Docker that I wasn't aware of of. This stackoverflow answer states that along with networking your PHP & MySQL services, you want to declare your MySQL host as the name of your MySQL service. You can see related aspects in index.php and docker-compose.yml

If you have any Questions feel I skipped over an import detail, I'd be glad to elaborate.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].