diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..b7be024 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,89 @@ +# Git +.git +.gitignore +.gitattributes + + +# CI +.codeclimate.yml +.travis.yml +.taskcluster.yml + +# Docker +docker-compose.yml +Dockerfile +.docker +.dockerignore + +# Byte-compiled / optimized / DLL files +**/__pycache__/ +**/*.py[cod] + +# C extensions +*.so + +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +*.egg-info/ +.installed.cfg +*.egg + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.coverage +.cache +nosetests.xml +coverage.xml + +# Translations +*.mo +*.pot + +# Django stuff: +*.log + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Virtual environment +.env +.venv/ +venv/ + +# PyCharm +.idea + +# Python mode for VIM +.ropeproject +**/.ropeproject + +# Vim swap files +**/*.swp + +# VS Code +.vscode/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6d17001 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,16 @@ +FROM python:3.13.5-slim + +EXPOSE 5000 + +WORKDIR /usr/src/app + +COPY requirements.txt . + +RUN python3 -m pip install --upgrade pip +RUN python3 -m pip install --no-cache-dir -r requirements.txt + +COPY . . + +RUN python3 -m pip install -e . + +CMD [ "gunicorn", "--config", "rstat_tool/gunicorn-cfg.py", "-k", "sync", "rstat_tool.dashboard:app" ] \ No newline at end of file diff --git a/rstat_tool/gunicorn-cfg.py b/rstat_tool/gunicorn-cfg.py new file mode 100644 index 0000000..d30966d --- /dev/null +++ b/rstat_tool/gunicorn-cfg.py @@ -0,0 +1,9 @@ +# -*- encoding: utf-8 -*- + +bind = '0.0.0.0:5000' +workers = 4 +worker_class = 'uvicorn.workers.UvicornWorker' +accesslog = '-' +loglevel = 'debug' +capture_output = True +enable_stdio_inheritance = True \ No newline at end of file