From b4961f646a6e265451aa414df9fb0d58b552ffdf Mon Sep 17 00:00:00 2001 From: 0livd Date: Wed, 25 Oct 2017 23:37:55 +0200 Subject: Add a DockerFile (#272) Can be used to deploy the latest version from PyPI in a production environment or from the master branch in a dev environment. --- docs/installation.rst | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/installation.rst b/docs/installation.rst index 9fd96b7..4a3aeae 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -56,7 +56,7 @@ Deploy it ========= Now, if you want to deploy it on your own server, you have many options. -Two of them are documented at the moment. +Three of them are documented at the moment. *Of course, if you want to contribute another configuration, feel free to open a pull-request against this repository!* @@ -113,6 +113,40 @@ With Nginx, Gunicorn and Supervisord .. [#nginx-vhosts] typically, */etc/nginx/conf.d/* or */etc/nginx/sites-available*, depending on your distribution. +With Docker +----------- + +Build the image:: + + docker build -t ihatemoney --build-arg INSTALL_FROM_PYPI=True . + +Start a daemonized Ihatemoney container:: + + docker run -d -p 8000:8000 ihatemoney + +Ihatemoney is now available on http://localhost:8000. + +All Ihatemoney settings can be passed with ``-e`` parameters +e.g. with a secure ``SECRET_KEY``, an external mail server and an external database:: + + docker run -d -p 8000:8000 \ + -e SECRET_KEY="supersecure" \ + -e SQLALCHEMY_DATABASE_URI="mysql+pymysql://user:pass@172.17.0.5/ihm" \ + -e MAIL_SERVER=smtp.gmail.com \ + -e MAIL_PORT=465 \ + -e MAIL_USERNAME=your-email@gmail.com \ + -e MAIL_PASSWORD=your-password \ + -e MAIL_USE_SSL=True \ + ihatemoney + +A volume can also be specified to persist the default database file:: + + docker run -d -p 8000:8000 -v /host/path/to/database:/database ihatemoney + +The following gunicorn parameters are also available:: + + GUNICORN_NUM_WORKERS (default: 3) + Configuration ============= -- cgit v1.1