Skip to content

Commit

Permalink
Merge pull request #690 from cytopia/release/v1.7.0
Browse files Browse the repository at this point in the history
Release v1.7.0
  • Loading branch information
cytopia committed Mar 25, 2020
2 parents bc16d89 + 487b693 commit 8c931cd
Show file tree
Hide file tree
Showing 15 changed files with 700 additions and 25 deletions.
4 changes: 2 additions & 2 deletions .devilbox/www/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
putenv('RES_OPTIONS=retrans:1 retry:1 timeout:1 attempts:1');


$DEVILBOX_VERSION = 'v1.6.3';
$DEVILBOX_DATE = '2020-03-23';
$DEVILBOX_VERSION = 'v1.7.0';
$DEVILBOX_DATE = '2020-03-24';
$DEVILBOX_API_PAGE = 'devilbox-api/status.json';

//
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ major versions.
## Unreleased


## Release v1.7.0 (2020-03-24)

#### Added
- Python Flask


## Bugfix Release v1.6.3 (2020-03-23)

#### Fixed
Expand Down
32 changes: 19 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,12 @@ Only the webserver and PHP container are mandatory, all others are optional and

Each of them is also available in multiple different versions in order to reflect your exact desired environment.

| Accel | Frontend | SQL | NoSQL | Queue | Search | ELK | Utils |
|---------|------------|------------|-----------|----------|--------|---------------|-----------|
| HAProxy | Apache | MariaDB | Memcached | RabbitMQ | Solr | ElasticSearch | Bind |
| Varnish | Nginx | MySQL | MongoDB | | | Logstash | Blackfire |
| | PHP | PerconaDB | Redis | | | Kibana | MailHog |
| | | PostgreSQL | | | | | Ngrok |
| Accel | Web | App | SQL | NoSQL | Queue / Search | ELK | Utils |
|---------|------------|----------------|------------|-----------|----------------|---------------|-----------|
| HAProxy | Apache | PHP | MariaDB | Memcached | RabbitMQ | ElasticSearch | Bind |
| Varnish | Nginx | Python (Flask) | MySQL | MongoDB | Solr | Logstash | Blackfire |
| | | | PerconaDB | Redis | | Kibana | MailHog |
| | | | PostgreSQL | | | | Ngrok |

> **Documentation:**
> [Available Container](https://devilbox.readthedocs.io/en/latest/readings/available-container.html)
Expand Down Expand Up @@ -374,6 +374,7 @@ Additionally to the default stack, there are a variety of other services that ca
<table>
<thead>
<tr>
<th>Python (Flask)</th>
<th>Blackfire</th>
<th>ELK</th>
<th>MailHog</th>
Expand All @@ -386,6 +387,7 @@ Additionally to the default stack, there are a variety of other services that ca
</thead>
<tbody>
<tr>
<td><a target="_blank" title="Python 2.7 " href="https://github.com/devilbox/docker-python-flask">2.7</a></td>
<td><a target="_blank" title="Blackfire 1.8" href="https://github.com/blackfireio/docker">1.8</a></td>
<td><a target="_blank" title="ELK stack" href="https://www.docker.elastic.co">5.x.y</a></td>
<td><a target="_blank" title="MailHog v1.0.0" href="https://github.com/mailhog/MailHog">v1.0.0</a></td>
Expand All @@ -396,6 +398,7 @@ Additionally to the default stack, there are a variety of other services that ca
<td><a target="_blank" title="Varnish 4" href="https://github.com/devilbox/docker-varnish">4</a></td>
</tr>
<tr>
<td>...</td>
<td>...</td>
<td><a target="_blank" title="ELK stack" href="https://www.docker.elastic.co">6.x.y</a></td>
<td><a target="_blank" title="MailHog latest" href="https://github.com/mailhog/MailHog">latest</a></td>
Expand All @@ -406,6 +409,7 @@ Additionally to the default stack, there are a variety of other services that ca
<td><a target="_blank" title="Varnish 5" href="https://github.com/devilbox/docker-varnish">5</a></td>
</tr>
<tr>
<td><a target="_blank" title="Python 3.7 " href="https://github.com/devilbox/docker-python-flask">3.7</a></td>
<td><a target="_blank" title="Blackfire 1.18.0" href="https://github.com/blackfireio/docker">1.18.0</a></td>
<td><a target="_blank" title="ELK stack" href="https://www.docker.elastic.co">7.x.y</a></td>
<td></td>
Expand All @@ -416,6 +420,7 @@ Additionally to the default stack, there are a variety of other services that ca
<td><a target="_blank" title="Varnish 6" href="https://github.com/devilbox/docker-varnish">6</a></td>
</tr>
<tr>
<td><a target="_blank" title="Python 3.8 " href="https://github.com/devilbox/docker-python-flask">3.8</a></td>
<td><a target="_blank" title="Blackfire latest" href="https://github.com/blackfireio/docker">latest</a></td>
<td></td>
<td></td>
Expand Down Expand Up @@ -650,8 +655,8 @@ The following tools will assist you on creating new projects easily as well as h
<td><code>pm2</code> is Node.js Production Process Manager with a built-in Load Balancer.</td>
</tr>
<tr>
<td>:wrench: <a href="https://github.com/brigade/scss-lint/">scss-lint</a></td>
<td><code>scss-lint</code> is a css/scss linter.</td>
<td>:wrench: <a href="https://github.com/stylelint/stylelint">stylelint</a></td>
<td><code>stylelint</code> is a css/scss linter.</td>
</tr>
<tr>
<td>:wrench: <a href="https://github.com/symfony/symfony-installer">symfony installer</a></td>
Expand Down Expand Up @@ -821,7 +826,7 @@ PHP modules can be enabled or disabled on demand to reflect the state of your ta

You can also copy any custom modules into `mod/(php-fpm)-<VERSION>` and add a custom `*.ini` file to load them.

#### Supported Frameworks
#### Supported PHP Frameworks

As far as tested there are no limitations and you can use any Framework or CMS just as you would on your live environment. Below are a few examples of extensively tested Frameworks and CMS:

Expand Down Expand Up @@ -867,12 +872,13 @@ As far as tested there are no limitations and you can use any Framework or CMS j
#### Supported reverse proxied applications

As far as tested there are no limitations and you can use any application that creates an open port.
These ports will be reverse proxied by the web server and even allow you to use valid HTTPS for them.
By the built-in autostart feature of the Devilbox you can ensure that your application automatically
These ports will be reverse proxied by the web server and even allow you to use **valid HTTPS** for them.
By the built-in **autostart feature** of the Devilbox you can ensure that your application automatically
starts up as soon as you run `docker-compose up`.

<a target="_blank" title="NodeJS" href="https://nodejs.org"><img width="64" style="width:64px;" src="docs/img/logo_tools/nodejs.png" alt="Devilbox"/></a>
<a target="_blank" title="Sphinx" href="https://www.sphinx-doc.org/en/stable/"><img width="64" style="width:64px;" src="docs/img/logo_tools/sphinx.png" alt="Devilbox"/></a>
<a target="_blank" title="NodeJS" href="https://nodejs.org"><img width="64" style="width:64px;" src="docs/img/logo_tools/nodejs.png" alt="NodeJS"/></a>
<a target="_blank" title="Python Flask" href="https://github.com/pallets/flask"><img width="64" style="width:64px;" src="docs/img/logo_tools/flask.png" alt="Python Flask"/></a>
<a target="_blank" title="Sphinx" href="https://www.sphinx-doc.org/en/stable/"><img width="64" style="width:64px;" src="docs/img/logo_tools/sphinx.png" alt="Sphinx"/></a>

> **Documentation:**<br/>
> [Setup reverse proxy NodeJs](https://devilbox.readthedocs.io/en/latest/examples/setup-reverse-proxy-nodejs.html) |
Expand Down
28 changes: 28 additions & 0 deletions compose/docker-compose.override.yml-all
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,34 @@ services:
depends_on:
- elastic

# -----------------------------------------------------------------------------------------------
# Python Flask
# -----------------------------------------------------------------------------------------------

# You can add more than one service here if you have multiple flask projects.
# Just duplicate the block and adjust service name, hostname and ip address.
flask1:
image: devilbox/python-flask:${PYTHON_VERSION:-3.8}-dev
hostname: flask1
ports:
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_FLASK:-3000}:${FLASK_PORT:-3000}"
networks:
app_net:
ipv4_address: 172.16.238.250
volumes:
# Mount custom mass virtual hosting
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
environment:
- FLASK_PROJECT=${FLASK_PROJECT}
- FLASK_PORT=${FLASK_PORT:-3000}
- FLASK_APP_DIR=${FLASK_APP_DIR:-htdocs}
- FLASK_APP_FILE=${FLASK_APP_FILE:-main.py}
- NEW_UID
- NEW_GID
depends_on:
- bind
- httpd


###
### Volumes
Expand Down
33 changes: 33 additions & 0 deletions compose/docker-compose.override.yml-python-flask.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# vim: set ft=yaml:
---
version: '2.3'

services:

# -----------------------------------------------------------------------------------------------
# Python Flask
# -----------------------------------------------------------------------------------------------

# You can add more than one service here if you have multiple flask projects.
# Just duplicate the block and adjust service name, hostname and ip address.
flask1:
image: devilbox/python-flask:${PYTHON_VERSION:-3.8}-dev
hostname: flask1
ports:
- "${LOCAL_LISTEN_ADDR}${HOST_PORT_FLASK:-3000}:${FLASK_PORT:-3000}"
networks:
app_net:
ipv4_address: 172.16.238.250
volumes:
# Mount custom mass virtual hosting
- ${HOST_PATH_HTTPD_DATADIR}:/shared/httpd:rw${MOUNT_OPTIONS}
environment:
- FLASK_PROJECT=${FLASK_PROJECT}
- FLASK_PORT=${FLASK_PORT:-3000}
- FLASK_APP_DIR=${FLASK_APP_DIR:-htdocs}
- FLASK_APP_FILE=${FLASK_APP_FILE:-main.py}
- NEW_UID
- NEW_GID
depends_on:
- bind
- httpd
12 changes: 5 additions & 7 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,11 @@ help:
# -------------------------------------------------------------------------------------------------

linkcheck2:
ifeq ($(wildcard file1),)
bash -c 'curl -Ss -o linkcheck https://raw.githubusercontent.com/cytopia/linkcheck/master/linkcheck 2>/dev/null'
else
bash -c 'curl -Ss -o linkcheck -z linkcheck https://raw.githubusercontent.com/cytopia/linkcheck/master/linkcheck 2>/dev/null'
endif
chmod +x linkcheck
./linkcheck -l -k -r 60 -t 30 -e rst _includes/
docker run \
--rm \
$$(tty -s && echo "-it" || echo) \
-v $(PWD):/data \
cytopia/linkcheck -l -k -r 60 -t 30 -e rst -c '200,204' _includes/

linkcheck:
docker run \
Expand Down
2 changes: 2 additions & 0 deletions docs/_includes/snippets/additional-container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@
+-------------------------------------+-----------+-----------+----------------+
| ELK: Kibana | kibana | kibana | 172.16.238.242 |
+-------------------------------------+-----------+-----------+----------------+
| Python Flask | flask1 | flask1 | 172.16.238.250 |
+-------------------------------------+-----------+-----------+----------------+
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ However, each example also exists in its standalone file as shown below:
├── docker-compose.override.yml-elk
├── docker-compose.override.yml-mailhog
├── docker-compose.override.yml-ngrok
├── docker-compose.override.yml-python-flask
├── docker-compose.override.yml-rabbitmq
├── docker-compose.override.yml-solr
├── docker-compose.override.yml-varnish
└── README.md
0 directories, 8 files
0 directories, 10 files
.. seealso:: :ref:`custom_container_enable_all_additional_container`
1 change: 1 addition & 0 deletions docs/custom-container/enable-all-container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ In order to fully customize each container, refer to their own documentation sec
* :ref:`custom_container_enable_elk_stack`
* :ref:`custom_container_enable_mailhog`
* :ref:`custom_container_enable_ngrok`
* :ref:`custom_container_enable_python_flask`
* :ref:`custom_container_enable_rabbitmq`
* :ref:`custom_container_enable_solr`
* :ref:`custom_container_enable_varnish`
149 changes: 149 additions & 0 deletions docs/custom-container/enable-python-flask.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
.. include:: /_includes/all.rst
.. include:: /_includes/snippets/__ANNOUNCEMENTS__.rst

.. _custom_container_enable_python_flask:

*********************************
Enable and configure Python Flask
*********************************

This section will guide you through getting Python Flask integrated into the Devilbox.

.. seealso::
* :ref:`example_setup_reverse_proxy_python_flask`
* :ref:`custom_container_enable_all_additional_container`
* :ref:`docker_compose_override_yml_how_does_it_work`


**Table of Contents**

.. contents:: :local:


Overview
========

Available overwrites
--------------------

.. include:: /_includes/snippets/docker-compose-override-tree-view.rst


Python Flask settings
---------------------

In case of Python Flask, the file is ``compose/docker-compose.override.yml-python-flask``. This file
must be copied into the root of the Devilbox git directory.

+-----------------------+----------------------------------------------------------------------------------------------------------+
| What | How and where |
+=======================+==========================================================================================================+
| Example compose file | ``compose/docker-compose.override.yml-all`` or |br| ``compose/docker-compose.override.yml-python-flask`` |
+-----------------------+----------------------------------------------------------------------------------------------------------+
| Container IP address | ``172.16.238.250`` |
+-----------------------+----------------------------------------------------------------------------------------------------------+
| Container host name | ``flask1`` |
+-----------------------+----------------------------------------------------------------------------------------------------------+
| Container name | ``flask1`` |
+-----------------------+----------------------------------------------------------------------------------------------------------+
| Mount points | ``data/www``` |
+-----------------------+----------------------------------------------------------------------------------------------------------+
| Exposed port | none |
+-----------------------+----------------------------------------------------------------------------------------------------------+
| Available at | Devilbox intranet via Reverse Proxy configuration |
+-----------------------+----------------------------------------------------------------------------------------------------------+
| Further configuration | :ref:`example_setup_reverse_proxy_python_flask` |
+-----------------------+----------------------------------------------------------------------------------------------------------+

Python Flask env variables
--------------------------

Additionally the following ``.env`` variables can be created for easy configuration:

+------------------------------+-------------------+----------------------------------------------------------------------------+
| Variable | Default value | Description |
+==============================+===================+============================================================================+
| ``FLASK_PROJECT`` | none | Specifies your Python Flask project dir in data/www. |
+------------------------------+-------------------+----------------------------------------------------------------------------+
| ``PYTHON_VERSION`` | ``3.8`` | Specifies the Python version to use for Flask. |
+------------------------------+-------------------+----------------------------------------------------------------------------+


Instructions
============

1. Copy docker-compose.override.yml
-----------------------------------

Copy the Python Flask Docker Compose overwrite file into the root of the Devilbox git directory.
(It must be at the same level as the default ``docker-compose.yml`` file).

.. code-block:: bash
host> cp compose/docker-compose.override.yml-python-flask docker-compose.override.yml
.. seealso::
* :ref:`docker_compose_override_yml`
* :ref:`add_your_own_docker_image`
* :ref:`overwrite_existing_docker_image`


2. Adjust ``.env`` settings (optional)
--------------------------------------

Python Flask is using sane defaults, which can be changed by adding variables to the ``.env`` file
and assigning custom values.

Add the following variables to ``.env`` and adjust them to your needs:

.. code-block:: bash
:caption: .env
# Project directory in data/www
FLASK_PROJECT=my-flask
# Python version to choose
#PYTHON_VERSION=2.7
#PYTHON_VERSION=3.5
#PYTHON_VERSION=3.6
#PYTHON_VERSION=3.7
PYTHON_VERSION=3.8
.. seealso:: :ref:`env_file`


3. Configure Reverse Proxy
--------------------------

Before starting up the devilbox you will need to configure your python flask project and the
reverse proxy settings.

.. seealso:: :ref:`example_setup_reverse_proxy_python_flask`


TL;DR
=====

For the lazy readers, here are all commands required to get you started.
Simply copy and paste the following block into your terminal from the root of your Devilbox git
directory:

.. code-block:: bash
# Copy compose-override.yml into place
cp compose/docker-compose.override.yml-flask1 docker-compose.override.yml
# Create .env variable
echo "# Project directory in data/www" > .env
echo "FLASK_PROJECT=my-flask" >> .env
echo "# Python version to choose" >> .env
echo "#PYTHON_VERSION=2.7" >> .env
echo "#PYTHON_VERSION=3.5" >> .env
echo "#PYTHON_VERSION=3.6" >> .env
echo "#PYTHON_VERSION=3.7" >> .env
echo "PYTHON_VERSION=3.8" >> .env
before starting up the devilbox you will need to configure your python flask project and the
reverse proxy settings.

.. seealso:: :ref:`example_setup_reverse_proxy_python_flask`
2 changes: 1 addition & 1 deletion docs/custom-container/enable-rabbitmq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ Add the following variables to ``.env`` and adjust them to your needs:
.. seealso:: :ref:`env_file`


4. Start the Devilbox
3. Start the Devilbox
---------------------

The final step is to start the Devilbox with RabbitMQ.
Expand Down
Loading

0 comments on commit 8c931cd

Please sign in to comment.