Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add dockerfile with ngxin+uwsgi, volumes and optional S3 storage #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fluential
Copy link

@fluential fluential commented Jul 14, 2020

Adressing all comments from #13

This implements

  • S3 persistent storage so its possible to safely start and stop container, it does restore on startup + backup after 30s delay, according to a schedule
  • uwsgi+nginx for much better performance

For yet better performance consider using ASGI frameworks instead of WSGI.
If you still need more +400% performance for this uwsgi+nginx flask app consider using this image https://github.com/tiangolo/meinheld-gunicorn-flask-docker 😎


COPY . /app
RUN pip install -r /var/www/requirements.txt
RUN chmod 755 /usr/local/bin/sq*
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,7 +1,7 @@
import os

# Location of database
DATABASE_FILE_PATH = os.path.abspath(os.getenv('DATABASE_FILE_PATH', 'data.db'))
DATABASE_FILE_PATH = os.path.abspath(os.getenv('DATABASE_FILE_PATH', 'data/data.db'))
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can configure the server to only count hits to domains matching a certain pattern. To do so, add regular expression entries to `URL_WHITELIST_RE` in `config.py`, e.g. `r'github\.com'`.


## Docker
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you put this in /docs/docker.md, add appropriate headings and link back in README.md please

@fluential
Copy link
Author

Thanks for update, to be honest I don't want to spend more time on this, I will not be submitting more changes. I'll leave it with you.

@brentvollebregt
Copy link
Owner

That's ok @fluential, thank you for your contribution. I will try to look into the questions/actions I have added and get this in when they're answered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants