diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..affd3a8 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,11 @@ +.venv +__pycache__ +*.pyc +*.pyo +*.pyd +*.db-shm +*.db-wal +.git +.gitignore +Dockerfile* +docker-compose*.yml diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..20a2eaf --- /dev/null +++ b/.env.example @@ -0,0 +1,2 @@ +# Copy to .env and set your own value +SECRET_KEY=replace-with-a-long-random-string diff --git a/Dockerfile b/Dockerfile index 94f05bc..8988f09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,4 @@ RUN mkdir -p /app/data /app/static/img EXPOSE 4545 -CMD ["gunicorn", "-c", "gunicorn_conf.py", "app:app"] +CMD ["gunicorn", "-c", "gunicorn_conf.py", "app:app"] diff --git a/__pycache__/app.cpython-314.pyc b/__pycache__/app.cpython-314.pyc new file mode 100644 index 0000000..3bed1f2 Binary files /dev/null and b/__pycache__/app.cpython-314.pyc differ diff --git a/app.py b/app.py index 2fa2aff..aa6dfd2 100644 --- a/app.py +++ b/app.py @@ -252,4 +252,4 @@ def health(): if __name__ == "__main__": init_db() - app.run(debug=True) + app.run(debug=True) diff --git a/data/infra.db b/data/infra.db new file mode 100644 index 0000000..2d6c8e8 Binary files /dev/null and b/data/infra.db differ diff --git a/data/leads.csv b/data/leads.csv new file mode 100644 index 0000000..7fa94ce --- /dev/null +++ b/data/leads.csv @@ -0,0 +1,2 @@ +created_at,name,company,phone,email,city,computers,message +2026-02-12T16:33:08,Иван,ООО Тест,123,,,10, diff --git a/docker-compose.yml b/docker-compose.yml index 5cf427e..f9e31e9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -17,4 +17,4 @@ services: interval: 20s timeout: 5s retries: 5 - start_period: 20s + start_period: 20s diff --git a/gunicorn_conf.py b/gunicorn_conf.py index 586a0fc..c63c0f4 100644 --- a/gunicorn_conf.py +++ b/gunicorn_conf.py @@ -1,7 +1,7 @@ import multiprocessing bind = "0.0.0.0:4545" -workers = 4 +workers = max(4, multiprocessing.cpu_count() * 2) threads = 4 timeout = 60 graceful_timeout = 30 diff --git a/requirements.txt b/requirements.txt index 9fe2d99..9c34537 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ Flask==3.1.0 -gunicorn==23.0.0 +gunicorn==23.0.0 diff --git a/static/img/README.txt b/static/img/README.txt new file mode 100644 index 0000000..3e9ae44 --- /dev/null +++ b/static/img/README.txt @@ -0,0 +1,4 @@ +Положите файл логотипа сюда: +static/img/infrait-logo.png + +Текущий шаблон уже подключен к этому пути. diff --git a/static/js/main.js b/static/js/main.js index 7e10227..932c4be 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -20,4 +20,4 @@ item.style.transition = `opacity .45s ease ${index * 0.03}s, transform .45s ease ${index * 0.03}s`; observer.observe(item); }); -})(); +})(); diff --git a/templates/admin_settings.html b/templates/admin_settings.html index a9c8b34..7714a29 100644 --- a/templates/admin_settings.html +++ b/templates/admin_settings.html @@ -74,4 +74,4 @@ - + diff --git a/templates/base.html b/templates/base.html index 9f5a482..a690ea5 100644 --- a/templates/base.html +++ b/templates/base.html @@ -34,4 +34,4 @@ {% block scripts %}{% endblock %} - + diff --git a/templates/index.html b/templates/index.html index e55da57..ad683d7 100644 --- a/templates/index.html +++ b/templates/index.html @@ -336,4 +336,4 @@ -{% endblock %} +{% endblock %}