diff --git a/ecosystem.config.js b/ecosystem.config.js new file mode 100644 index 0000000..7d5fee4 --- /dev/null +++ b/ecosystem.config.js @@ -0,0 +1,9 @@ +module.exports = { + "apps" : [ + { + "name" : "wanlanda.ru", + "script" : "main.py" + } + ] + } + \ No newline at end of file diff --git a/app/main.py b/main.py similarity index 95% rename from app/main.py rename to main.py index ed4693f..3b0d5a5 100644 --- a/app/main.py +++ b/main.py @@ -4,6 +4,8 @@ from fastapi.staticfiles import StaticFiles from fastapi.templating import Jinja2Templates from pydantic import BaseModel, EmailStr from aiogram import Bot, Dispatcher +from fastapi.middleware.wsgi import WSGIMiddleware +import uvicorn BOT_TOKEN = '7102060229:AAE4SWmgKXkCBC482l8Ble5lKzlCV2YIWnM' ID = '340394898' @@ -14,6 +16,9 @@ bot = Bot( # Образ Бота app = FastAPI() +# Для совместимости с WSGI +application = WSGIMiddleware(app) + # Монтирование статических файлов app.mount("/static", StaticFiles(directory="app/static"), name="static") @@ -102,4 +107,4 @@ Email: {form_data.email} if __name__ == "__main__": import uvicorn - uvicorn.run(app, host="0.0.0.0", port=8000) \ No newline at end of file + uvicorn.run(app, host="0.0.0.0", port=20001) \ No newline at end of file diff --git a/passenger_wsgi.py b/passenger_wsgi.py new file mode 100644 index 0000000..d0e0d61 --- /dev/null +++ b/passenger_wsgi.py @@ -0,0 +1,11 @@ +import sys + +import os + +INTERP = os.path.expanduser("/var/www/www-root/data/www/sybiko.ru/.venv/bin/python") +if sys.executable != INTERP: + os.execl(INTERP, INTERP, *sys.argv) + +sys.path.append(os.getcwd()) + +from main import application \ No newline at end of file diff --git a/app/static/.DS_Store b/static/.DS_Store similarity index 100% rename from app/static/.DS_Store rename to static/.DS_Store diff --git a/app/static/img/.DS_Store b/static/img/.DS_Store similarity index 100% rename from app/static/img/.DS_Store rename to static/img/.DS_Store diff --git a/app/static/img/air-filter.jpg b/static/img/air-filter.jpg similarity index 100% rename from app/static/img/air-filter.jpg rename to static/img/air-filter.jpg diff --git a/app/static/img/b1.jpg b/static/img/b1.jpg similarity index 100% rename from app/static/img/b1.jpg rename to static/img/b1.jpg diff --git a/app/static/img/cabin-filter.jpg b/static/img/cabin-filter.jpg similarity index 100% rename from app/static/img/cabin-filter.jpg rename to static/img/cabin-filter.jpg diff --git a/app/static/img/certificates/сертификат1.png b/static/img/certificates/сертификат1.png similarity index 100% rename from app/static/img/certificates/сертификат1.png rename to static/img/certificates/сертификат1.png diff --git a/app/static/img/certificates/сертификат2.png b/static/img/certificates/сертификат2.png similarity index 100% rename from app/static/img/certificates/сертификат2.png rename to static/img/certificates/сертификат2.png diff --git a/app/static/img/certificates/сертификат3.png b/static/img/certificates/сертификат3.png similarity index 100% rename from app/static/img/certificates/сертификат3.png rename to static/img/certificates/сертификат3.png diff --git a/app/static/img/certificates/сертификат4.png b/static/img/certificates/сертификат4.png similarity index 100% rename from app/static/img/certificates/сертификат4.png rename to static/img/certificates/сертификат4.png diff --git a/app/static/img/fuel-filter.jpg b/static/img/fuel-filter.jpg similarity index 100% rename from app/static/img/fuel-filter.jpg rename to static/img/fuel-filter.jpg diff --git a/app/static/img/oil-filter.jpg b/static/img/oil-filter.jpg similarity index 100% rename from app/static/img/oil-filter.jpg rename to static/img/oil-filter.jpg diff --git a/app/static/img/pbanner.jpg b/static/img/pbanner.jpg similarity index 100% rename from app/static/img/pbanner.jpg rename to static/img/pbanner.jpg diff --git a/app/static/img/salon-filter.jpg b/static/img/salon-filter.jpg similarity index 100% rename from app/static/img/salon-filter.jpg rename to static/img/salon-filter.jpg diff --git a/app/static/js/main.js b/static/js/main.js similarity index 100% rename from app/static/js/main.js rename to static/js/main.js diff --git a/app/templates/.DS_Store b/templates/.DS_Store similarity index 100% rename from app/templates/.DS_Store rename to templates/.DS_Store diff --git a/app/templates/about.html b/templates/about.html similarity index 100% rename from app/templates/about.html rename to templates/about.html diff --git a/app/templates/base.html b/templates/base.html similarity index 100% rename from app/templates/base.html rename to templates/base.html diff --git a/app/templates/catalog.html b/templates/catalog.html similarity index 100% rename from app/templates/catalog.html rename to templates/catalog.html diff --git a/app/templates/catalog_air-filters.html b/templates/catalog_air-filters.html similarity index 100% rename from app/templates/catalog_air-filters.html rename to templates/catalog_air-filters.html diff --git a/app/templates/catalog_cabin-filters.html b/templates/catalog_cabin-filters.html similarity index 100% rename from app/templates/catalog_cabin-filters.html rename to templates/catalog_cabin-filters.html diff --git a/app/templates/catalog_fuel-filters.html b/templates/catalog_fuel-filters.html similarity index 100% rename from app/templates/catalog_fuel-filters.html rename to templates/catalog_fuel-filters.html diff --git a/app/templates/catalog_oil-filters.html b/templates/catalog_oil-filters.html similarity index 100% rename from app/templates/catalog_oil-filters.html rename to templates/catalog_oil-filters.html diff --git a/app/templates/certificates.html b/templates/certificates.html similarity index 100% rename from app/templates/certificates.html rename to templates/certificates.html diff --git a/app/templates/contacts.html b/templates/contacts.html similarity index 100% rename from app/templates/contacts.html rename to templates/contacts.html diff --git a/app/templates/index.html b/templates/index.html similarity index 100% rename from app/templates/index.html rename to templates/index.html