{"id":444842,"date":"2025-01-13T15:03:58","date_gmt":"2025-01-13T15:03:58","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=444842"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=444842","title":{"rendered":"<span>\u0421\u0431\u043e\u0440\u043a\u0430 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Nuitka \u0432 onefile<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/205\/abb\/115\/205abb115db7cddf375cff543502f927.png\" width=\"1560\" height=\"880\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/205\/abb\/115\/205abb115db7cddf375cff543502f927.png\"\/><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u0430\u043d\u0438\u043b, \u0438 \u044f \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0423\u0432\u0435\u043e\u043d. \u0417\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e Termidesk Assistant &#8212; \u044d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0442\u043e\u043b\u043e\u0432.<\/p>\n<p>\u041a \u043d\u0430\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u0440\u0438\u0448\u043b\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432 \u043e\u0434\u0438\u043d \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (.elf) \u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b (.deb), \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u0438 \u043f\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Termidesk Assistant \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u044f\u0445.<\/p>\n<p>\u041e Nuitka \u043c\u0430\u043b\u043e \u0447\u0442\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0432 Python-\u0441\u0440\u0435\u0434\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0437\u044f\u0442\u044c\u0441\u044f \u0437\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u0442\u043e, \u0447\u0442\u043e \u0443\u0441\u043f\u0435\u043b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0437\u0430\u0434\u0430\u0447\u0435\u0439.<\/p>\n<h2>1.\u00a0\u00a0\u0427\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 Nuitka?<\/h2>\n<p>Nuitka &#8212; \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 (\u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434 Python \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 C\/C++. \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043d \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u0434 Python \u0432 C++, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u0435\u0433\u043e, \u0430 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 C++ \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (elf, exe \u0438 \u0442.\u0434.)<\/p>\n<h2>2.\u00a0\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 Nuitka<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Nuitka, Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438 PyInstaller, \u0443 Nuitka \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432:<\/p>\n<ol>\n<li>\n<p><strong>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/strong><br \/>Nuitka \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 Python-\u043a\u043e\u0434 \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c Python-\u043a\u043e\u0434\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/strong><br \/>Nuitka \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0438\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 PyInstaller, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0417\u0430\u0449\u0438\u0442\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/strong><br \/>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c<\/strong><br \/>Nuitka \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/strong><br \/>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Docker, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u041f\u041e \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435.<\/p>\n<\/li>\n<\/ol>\n<h2>3.\u00a0\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 Nuitka<\/h2>\n<ol>\n<li>\n<p><strong>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/strong><br \/>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Nuitka \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Django \u0438 \u0432\u0441\u0435\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Docker \u0438\u043b\u0438 PyInstaller.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong><br \/>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 Nuitka \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Docker-\u043e\u0431\u0440\u0430\u0437\u0430 \u0438\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u0441 PyInstaller.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432 Python<\/strong><br \/>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Python (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439) \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438\u043b\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438<\/strong><br \/>\u041d\u0435 \u0432\u0441\u0435 Python-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 Nuitka.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0442\u043b\u0430\u0434\u043a\u0430<\/strong><br \/>\u041e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 (\u0434\u0435\u0431\u0430\u0433 \u0442\u0443\u0442 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u0442\u043e\u043b\u044c\u043a\u043e print, \u0433\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f), \u0447\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0438\u043b\u0438 \u043a\u043e\u0434 \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/strong><br \/>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0441 Nuitka, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441 Docker \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438<\/strong><br \/>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Docker, Nuitka \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430\u043c \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438. \u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 onefile, \u043d\u043e \u043e\u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u041e\u0421 \u0438 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b, \u043a\u0430\u043a \u044f \u044d\u0442\u043e \u043e\u0431\u0445\u043e\u0434\u0438\u043b &#8212; \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u043d\u044c\u0448\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/strong><br \/>Nuitka \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435 Django \u0438 Python \u0432\u043e\u043e\u0431\u0449\u0435, \u0447\u0435\u043c Docker, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u043b\u0443\u0447\u0448\u0438\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0437\u0434\u0435\u0441\u044c \ud83d\ude42<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c<\/strong><br \/>Docker \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<\/ol>\n<h2>4.\u00a0\u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u0435\u043c: \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 Nuitka \u0441 Pyinstaller \u0438 Docker<\/h2>\n<p>Pyinstaller\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a Nuitka \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u0434 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439, \u0447\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u0430\u0449\u0438\u0442\u044b \u043a\u043e\u0434\u0430 \u043e\u0442 \u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Docker, Nuitka &#8212; \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0435 \u041f\u041e. \u042d\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0443 \u043d\u0430\u0448\u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0431\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<h2>5.\u00a0\u0421\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Nuitka \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/h2>\n<ol>\n<li>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 bash-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445<\/strong>&#8212; \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b.- \u041f\u0440\u0438\u043c\u0435\u0440:&#171;`bash#!\/bin\/bashpython -m nuitka &#8212;follow-imports &#8212;standalone &#8212;output-dir=build myscript.py&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b<\/strong>&#8212; GitFlic CI:&#171;`yaml<br \/>build_job:<br \/>script:<br \/>&#8212; pip install nuitka<br \/>&#8212; python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<br \/>&#171;`<br \/>&#8212; Jenkins:<br \/>&#171;`groovy<br \/>stage(&#8216;Build&#8217;) {<br \/>steps {<br \/>sh &#8216;pip install nuitka&#8217;<br \/>sh &#8216;python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py&#8217;<br \/>}<br \/>}<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 setup.py<\/strong>&#8212; \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f Nuitka \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u0430:<br \/>&#171;`python<br \/>from setuptools import setup<br \/>from nuitka.distutils_based_buildsystem.BuildSystem import Nuitka<\/p>\n<p>setup(<br \/>name=&#187;MyApp&#187;,<br \/>cmdclass={&#171;build_exe&#187;: Nuitka},<br \/># \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b&#8230;<br \/>)<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>GitHub Actions workflow<\/strong>&#8212; \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438 push \u0438\u043b\u0438 pull request:<br \/>&#171;`yaml<br \/>name: Build with Nuitka<br \/>on: [push, pull_request]<br \/>jobs:<br \/>build:<br \/>runs-on: ubuntu-latest<br \/>steps:<br \/>&#8212; uses: actions\/checkout@v2<br \/>&#8212; name: Set up Python<br \/>uses: actions\/setup-python@v2<br \/>&#8212; name: Install dependencies<br \/>run: |<br \/>pip install nuitka<br \/>&#8212; name: Build with Nuitka<br \/>run: python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>Makefile<\/strong>&#8212; \u0423\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0431\u043e\u0440\u043a\u0438:<br \/>&#171;`makefile<br \/>build:<br \/>python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<\/p>\n<p>clean:<br \/>rm -rf build\/<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>Docker<\/strong>&#8212; \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Nuitka \u0432\u043d\u0443\u0442\u0440\u0438 Docker \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439:<br \/>&#171;`dockerfile<br \/>FROM python:3.9<br \/>RUN pip install nuitka<br \/>COPY . \/app<br \/>WORKDIR \/app<br \/>RUN python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>Tox<\/strong>&#8212; \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f Nuitka \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<br \/>&#171;`ini<br \/>[testenv:build]<br \/>deps = nuitka<br \/>commands = python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>Pre-commit hooks<\/strong>&#8212; \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c:<br \/>&#171;`yaml<br \/>&#8212; repo: local<br \/>hooks:<br \/>&#8212; id: nuitka-build<br \/>name: Build with Nuitka<br \/>entry: python -m nuitka &#8212;follow-imports &#8212;standalone<br \/>language: system<br \/>files: ^myapp\\.py$<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438<\/strong>&#8212; \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u0432\u0440\u043e\u0434\u0435 apt, yum \u0438\u043b\u0438 Homebrew \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Nuitka \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Nuitka \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u044f \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u0434\u0435\u043b\u0430\u044f \u0435\u0451 \u0447\u0430\u0441\u0442\u044c\u044e \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0412\u044b\u0431\u043e\u0440 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<h2>6.\u00a0\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435: \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u043c\u043e\u0435\u043c \u043e\u043f\u044b\u0442\u0435<\/h2>\n<h3>6.1.\u00a0\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0435\u0434\u0438\u043d\u044b\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442. \u0415\u0441\u043b\u0438 \u0431\u0435\u0437 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439, \u044f \u0437\u0430\u043c\u0435\u043d\u0438\u043b Memcached \u043d\u0430 python-memcached \u0438 Redis \u043d\u0430 Fakeredis. \u0422\u0443\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0414\u0430\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u044c \u0447\u0443\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 &#8212; \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440. \u0423 \u043d\u0430\u0441 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b Apache2, \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a FastAPI, \u0435\u0441\u043b\u0438 \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b, \u0442\u043e \u0432\u043e\u0442 \u043a\u043e\u0434:<br \/><strong>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432:<\/strong><\/p>\n<pre><code class=\"python\">def find_static_files():    if getattr(sys, 'frozen', False):        base_path = getattr(sys, '_MEIPASS', os.path.dirname(sys.executable))    else:        base_path = os.path.dirname(os.path.abspath(__file__))      possible_paths = [        os.path.join(base_path, 'static'),        os.path.join(base_path, 'django_termidesk_assistant', 'static'),        os.path.join(base_path, 'src', 'django_termidesk_assistant', 'static'),        os.path.join(os.path.dirname(base_path), 'static'),        '\/tmp\/onefile_*\/static'    ]      for path in possible_paths:        if '*' in path:            import glob            matching_paths = glob.glob(path)            if matching_paths:                return matching_paths[0]        elif os.path.exists(path) and os.path.isdir(path):            return path      print(\"Static files not found in any of the expected locations.\")    return None     def setup_static_files(app):    static_path = find_static_files()    if static_path:        if getattr(sys, 'frozen', False):            temp_dir = tempfile.mkdtemp()            temp_static_path = os.path.join(temp_dir, 'static')            shutil.copytree(static_path, temp_static_path)            static_path = temp_static_path          app.mount(\"\/assistant\/static\", StaticFiles(directory=static_path), name=\"static\")        return app    else:        print(\"Warning: Static files not found. Static content will not be served.\")        return None     fastapi_app = setup_static_files(fastapi_app)<\/code><\/pre>\n<p><strong>\u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442:<\/strong><\/p>\n<pre><code class=\"python\">@fastapi_app.exception_handler(404) async def custom_404_handler(request: Request, exc: Exception):    return RedirectResponse(url=\"\/assistant\/\")<\/code><\/pre>\n<p><strong>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0434\u043b\u044f https:<\/strong><\/p>\n<pre><code class=\"python\">def generate_ssl_certificates():    try:        subprocess.run(['openssl', 'genrsa', '-out', 'privkey.pem', '2048'], check=True)        subprocess.run(['openssl', 'req', '-new', '-x509', '-key', 'privkey.pem',                        '-out', 'fullchain.pem', '-days', '365', '-subj', \"\/CN=localhost\"], check=True)    except subprocess.CalledProcessError as e:        print(f\"Failed to generate SSL certificates: {e}\")        raise<\/code><\/pre>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a http \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/strong><\/p>\n<pre><code class=\"python\">def run_http_server():    config = Config(fastapi_app, host=\"0.0.0.0\", port=80)    server = Server(config=config)    try:        server.run()    except Exception as e:        print(f\"Server error on port 80: {e}\")<\/code><\/pre>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a https \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/strong><\/p>\n<pre><code class=\"python\">def run_https_server():    generate_ssl_certificates()      certfile = \"fullchain.pem\"    keyfile = \"privkey.pem\"      config = Config(fastapi_app, host=\"0.0.0.0\", port=443,                    ssl_keyfile=keyfile, ssl_certfile=certfile)    server = Server(config=config)    try:        server.run()    except Exception as e:        print(f\"Server error on port 443: {e}\")<\/code><\/pre>\n<p><strong>\u0414\u0430\u043b\u044c\u0448\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 (\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d &#8212; \u043d\u0435 \u0432\u044b\u0448\u043b\u043e):<\/strong><\/p>\n<pre><code class=\"python\">multiprocessing.freeze_support() http_process = multiprocessing.Process(target=run_http_server) https_process = multiprocessing.Process(target=run_https_server) daphne_process = multiprocessing.Process(target=run_daphne)   http_process.start() https_process.start() daphne_process.start()<\/code><\/pre>\n<p>run_daphne &#8212; \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<h3>6.2.\u00a0GitFlic-\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u0432 Nuitka<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0430 CI\/CD \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<h4>6.2.1.\u00a0\u0421\u0431\u043e\u0440\u043a\u0430 elf-\u0444\u0430\u0439\u043b\u0430<\/h4>\n<pre><code class=\"yaml\">build_nuitka_elf:  image: \"python:3.8-buster\"  stage: build  tags:    - at-docker  before_script:    - python -m venv venv    - source venv\/bin\/activate    - pip install --upgrade pip    - pip install --upgrade setuptools wheel    - apt -y update &gt;\/dev\/null    - apt install -y gettext patchelf &gt;\/dev\/null    - export PATH=$PATH:\/usr\/sbin    - pip install -r ${CI_PROJECT_DIR}\/src\/django_termidesk_assistant\/requirements.txt    - pip install uvicorn==0.17.6 fastapi==0.78.0 starlette==0.19.1    - cd ${CI_PROJECT_DIR}\/src\/django_termidesk_assistant    - python manage.py makemigrations &gt;\/dev\/null    - python manage.py migrate &gt;\/dev\/null    - python manage.py createcachetable &gt;\/dev\/null    - python manage.py collectstatic --noinput &gt;\/dev\/null    - python manage.py compilemessages &gt;\/dev\/null  script:    - cd ${CI_PROJECT_DIR}    - export PYTHONPATH=$PYTHONPATH:${CI_PROJECT_DIR}\/src\/django_termidesk_assistant    - export DJANGO_SETTINGS_MODULE=django_termidesk_assistant.settings    - pip install nuitka==1.5.4    - python -m nuitka      --remove-output      --follow-imports      --include-module=django_termidesk_assistant.settings      --include-package=django_termidesk_assistant      --include-package=termidesk_assistant      --include-package=signalling      --include-module=termidesk_assistant.middleware      --include-package=django      --include-module=django.core.management      --include-package=channels      --include-package=channels_redis      --include-package=fakeredis      --include-package=asgiref      --include-package=django.templatetags.i18n      --include-package=daphne      --include-package=rest_framework      --include-module=django_termidesk_assistant.asgi      --include-package=django_structlog      --include-package=gettext      --include-package=uvicorn      --include-package=fastapi      --include-package=starlette      --include-data-dir=${CI_PROJECT_DIR}\/src\/django_termidesk_assistant\/termidesk_assistant=termidesk_assistant      --include-data-dir=${CI_PROJECT_DIR}\/src\/django_termidesk_assistant\/static=static      --include-data-dir=${CI_PROJECT_DIR}\/src\/django_termidesk_assistant\/locale=locale      --include-data-dir=${CI_PROJECT_DIR}\/src\/django_termidesk_assistant\/var\/db=var\/db      --include-data-dir=${CI_PROJECT_DIR}\/src\/django_termidesk_assistant\/var\/log=var\/log      --output-dir=${CI_PROJECT_DIR}\/dist      --onefile      --onefile-tempdir-spec=\/tmp\/onefile_%PID%_%TIME%      --output-filename=termidesk_assistant_server.bin      ${CI_PROJECT_DIR}\/src\/django_termidesk_assistant\/run_servers.py  artifacts:    expire_in: 1 day    paths:      - dist\/<\/code><\/pre>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043f\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u043e (\u043d\u0443, \u043f\u043e\u0447\u0442\u0438).<\/p>\n<p>\u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0437 \u0434\u043e\u043a\u0435\u0440\u0430 python:3.8-buster, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u0435\u0440\u0441\u0438\u0438 \u0432\u044b\u0448\u0435 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 glibc \u043d\u0430 Astra Linux: glibc_2.33&#8242; not found. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043d\u0430\u0448\u0430 \u043a\u043e\u0434\u043e\u0432\u0430\u044f \u0431\u0430\u0437\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0434\u043b\u044f python 3.7, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u044f\u0445 Astra Linux SE \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f Python \u044d\u0442\u043e 3.7.3, \u043a\u0430\u043a \u0438 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u0439 \u0432 \u041e\u0421 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u0430\u043a\u0442\u0438\u0432\u0438\u0440\u0443\u0435\u043c \u0432\u0438\u0440\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u0438 \u0441\u0442\u0430\u0432\u0438\u043c patchelf, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 elf-\u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p>\u041c\u043e\u0436\u043d\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e uvicorn, fastapi \u0438 starlette \u0441\u0442\u0430\u0432\u044f\u0442\u0441\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e, \u044f \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0438\u0445 \u0432\u044b\u043d\u0435\u0441 \u0438\u0437 requirements.txt, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043e\u043d\u0438 \u043d\u0443\u0436\u043d\u044b \u0438\u0441\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u0432 Nuitka \u0438 \u043a\u0430\u0441\u0442\u043e\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u0430 \u0443 \u043d\u0430\u0441 \u0435\u0449\u0435 \u0435\u0441\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 Termidesk Assistant.<\/p>\n<p>\u041f\u043e\u0442\u043e\u043c \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c\u0441\u044f \u043f\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c Django-\u043a\u043e\u043c\u0430\u043d\u0434\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u043f\u0435\u0440\u0435\u0434 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u043c \u043b\u044e\u0431\u043e\u0433\u043e Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0441\u0431\u043e\u0440\u043a\u0435. \u041c\u044b \u0441\u0442\u0430\u0432\u0438\u043c Nuitka \u0432\u0435\u0440\u0441\u0438\u0438 1.5.4, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u043c\u043f\u0438\u0440\u0438\u0447\u0435\u0441\u043a\u0438 \u0431\u044b\u043b\u043e \u0432\u044b\u044f\u0441\u043d\u0435\u043d\u043e, \u0447\u0442\u043e \u043e\u043d\u0430 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0434\u043b\u044f python 3.8 \u0438 \u0442\u0435\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u044b \u0434\u043b\u044f \u043a\u043e\u0434\u043e\u0432\u043e\u0439 \u0431\u0430\u0437\u044b python 3.7. \u041f\u0440\u043e\u0439\u0434\u0435\u043c\u0441\u044f \u043f\u043e \u0441\u0430\u043c\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c Nuitka:<br \/><em>&#8212;remove-output<\/em>\u00a0&#8212; \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0435 C-\u0444\u0430\u0439\u043b\u043e\u0432 \u0438\u0437 python-\u043c\u043e\u0434\u0443\u043b\u044f \u043f\u043e\u0441\u043b\u0435 \u0441\u0431\u043e\u0440\u043a\u0438.<\/p>\n<p><em>&#8212;follow-imports<\/em>\u00a0&#8212; \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c.<\/p>\n<p><em>&#8212;include-module<\/em>\u00a0\u0438\u00a0<em>&#8212;include-package<\/em>\u00a0&#8212; \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0431\u043e\u0440\u043a\u0438, \u0442\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0443\u0436\u043d\u044b\u0439 \u043d\u0430\u043c \u0438\u043c\u043f\u043e\u0440\u0442. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0435\u0440\u0435\u0437\u00a0&#8212;include-package\u00a0\u044f \u0432\u043a\u043b\u044e\u0447\u0430\u043b \u0442\u0430\u043a\u0436\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p><em>&#8212;include-data-dir<\/em>\u00a0&#8212; \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0434\u043b\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0430\u043f\u043a\u0438, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u044d\u0442\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0430\u0439\u043b\u044b.<\/p>\n<p><em>&#8212;output-dir<\/em>\u00a0&#8212; \u043f\u0430\u043f\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u043d\u0430\u0448 \u0431\u0438\u043b\u0434-\u0444\u0430\u0439\u043b \u0432\u043d\u0443\u0442\u0440\u0438 \u0434\u043e\u043a\u0435\u0440-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430.<\/p>\n<p><em>&#8212;onefile<\/em>\u00a0&#8212; \u0444\u043e\u0440\u043c\u0430\u0442 \u0431\u0438\u043b\u0434\u0430, \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0435\u0434\u0438\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0431\u0435\u0437 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u044b\u0445 \u043f\u0430\u043f\u043e\u043a \u0438 \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<p><em>&#8212;onefile-tempdir-spec<\/em>\u00a0&#8212; \u043f\u0443\u0442\u044c \u0434\u043e \u043f\u0430\u043f\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0443\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0431\u0438\u043b\u0434\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0444\u0430\u0439\u043b\u044b \u043a\u044d\u0448\u0430.<\/p>\n<p><em>&#8212;output-filename<\/em>\u00a0&#8212; \u0438\u043c\u044f \u0431\u0438\u043b\u0434-\u0444\u0430\u0439\u043b\u0430, \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0439 \u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043d\u0435\u0442.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432\u0445\u043e\u0434\u0430, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0441\u0435\u0440\u0432\u0435\u0440\u043e\u0432.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0432\u00a0artifacts\u00a0\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441\u0431\u043e\u0440\u043a\u0438 \u043d\u0430 CI\/CD &#8212; \u0441\u0435\u0440\u0432\u0435\u0440\u0435 \u0438 \u043f\u0430\u043f\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u043b\u0435\u0436\u0430\u0442\u044c \u0444\u0430\u0439\u043b \u0432\u043d\u0443\u0442\u0440\u0438 zip-\u0444\u0430\u0439\u043b\u0430.<\/p>\n<h4>6.2.2.\u00a0\u0421\u0431\u043e\u0440\u043a\u0430 deb-\u0444\u0430\u0439\u043b\u0430<\/h4>\n<pre><code class=\"yaml\">build_nuitka_deb_package:  image: \"python:3.8-buster\"  stage: package  tags:    - at-docker  dependencies:    - build_nuitka_elf  before_script:    - apt-get update    - apt-get install -y dpkg-dev  script:    - |      if [ -z \"${CI_COMMIT_TAG}\" ]; then        export PACKAGE_VERSION=$(date +%Y%m%d%H%M%S)      else        export PACKAGE_VERSION=${CI_COMMIT_TAG}      fi    - export PACKAGE_NAME=\"termidesk-assistant-server${PACKAGE_VERSION}\"    - mkdir -p ${PACKAGE_NAME}\/DEBIAN    - mkdir -p ${PACKAGE_NAME}\/usr\/local\/bin    - mkdir -p ${PACKAGE_NAME}\/etc\/systemd\/system    - mkdir -p ${PACKAGE_NAME}\/var\/lib\/termidesk-assistant    - mkdir -p ${PACKAGE_NAME}\/var\/log\/termidesk-assistant    - cp dist\/termidesk_assistant_server.bin ${PACKAGE_NAME}\/usr\/local\/bin\/    - chmod +x ${PACKAGE_NAME}\/usr\/local\/bin\/termidesk_assistant_server.bin      - |      cat &lt;&lt; EOF &gt; ${PACKAGE_NAME}\/DEBIAN\/control      Package: termidesk-assistant-server      Version: ${PACKAGE_VERSION}      Maintainer: Release Team &lt;release@uveon.ru&gt;      Architecture: amd64      Section: non-free\/admin      Priority: optional      Description: Termidesk Assistant Server      Homepage: http:\/\/uveon.ru\/      EOF      - |      cat &lt;&lt; EOF &gt; ${PACKAGE_NAME}\/etc\/systemd\/system\/termidesk-assistant.service      [Unit]      Description=Termidesk Assistant Server      After=network.target        [Service]      ExecStart=\/usr\/local\/bin\/termidesk_assistant_server.bin      Restart=on-failure      RestartSec=5           User=root      Group=root      Environment=PATH=\/usr\/bin:\/usr\/local\/bin      WorkingDirectory=\/var\/lib\/termidesk-assistant           StandardOutput=append:\/var\/log\/termidesk-assistant\/service.log      StandardError=append:\/var\/log\/termidesk-assistant\/service.log        [Install]      WantedBy=multi-user.target      EOF      - |      cat &lt;&lt; EOF &gt; ${PACKAGE_NAME}\/DEBIAN\/postinst      #!\/bin\/bash      set -e        # Log file for installation      LOG_FILE=\"\/var\/lib\/termidesk-assistant\/install.log\"        log() {          echo \"\\$(date): \\$1\" &gt;&gt; \\$LOG_FILE      }        log \"Starting postinst script\"        # Create necessary directories      mkdir -p \/var\/lib\/termidesk-assistant \/var\/log\/termidesk-assistant      chown root:root \/var\/lib\/termidesk-assistant \/var\/log\/termidesk-assistant      chmod 755 \/var\/lib\/termidesk-assistant \/var\/log\/termidesk-assistant      log \"Created necessary directories\"        # Reload systemd to recognize the new service      systemctl daemon-reload      log \"Systemd reloaded\"        # Enable the service to start on boot      systemctl enable termidesk-assistant.service      log \"Service enabled\"        # Start the service      systemctl start termidesk-assistant.service      log \"Service start command issued\"        # Check if the service is running      sleep 5  # Give the service a moment to start      if systemctl is-active --quiet termidesk-assistant.service; then          log \"Service is running successfully\"      else          log \"Service failed to start. Check systemctl status termidesk-assistant.service for more info\"          systemctl status termidesk-assistant.service &gt;&gt; \\$LOG_FILE 2&gt;&amp;1          journalctl -u termidesk-assistant.service --no-pager &gt;&gt; \\$LOG_FILE      fi        # Check if the service is enabled      if systemctl is-enabled --quiet termidesk-assistant.service; then          log \"Service is enabled for autostart\"      else          log \"WARNING: Service is not enabled for autostart\"      fi        log \"Postinst script completed\"        exit 0      EOF      - chmod 755 ${PACKAGE_NAME}\/DEBIAN\/postinst      - dpkg-deb --build ${PACKAGE_NAME}  artifacts:    expire_in: 1 day    paths:      - .\/*.deb<\/code><\/pre>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0442\u0430\u043a\u0436\u0435, \u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0447\u0442\u043e stage \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c, \u0438\u043d\u0430\u0447\u0435 \u043d\u0435 \u0432\u044b\u0439\u0434\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u043c\u0443:<\/p>\n<pre><code class=\"yaml\">dependencies:    - build_nuitka_elf<\/code><\/pre>\n<p>\u041a\u0440\u0430\u0442\u043a\u043e, \u0442\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430 \u043e\u0442 \u043f\u0435\u0440\u0432\u043e\u0433\u043e:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/e86\/b98\/862\/e86b988620489e995594b7abcf0e08ac.png\" width=\"802\" height=\"122\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e86\/b98\/862\/e86b988620489e995594b7abcf0e08ac.png\"\/><\/figure>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0441\u0442\u0430\u0432\u0438\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043f\u0430\u043a\u0435\u0442 dpkg-dev \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 deb-\u0444\u0430\u0439\u043b\u0430.<br \/>\u041f\u0435\u0440\u0435\u0439\u0434\u0435\u043c \u043a \u0447\u0430\u0441\u0442\u0438 script \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430:<\/p>\n<p>\u0412\u0432\u043e\u0434\u0438\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e PACKAGE_NAME, \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043d\u0430 \u0438\u043c\u0435\u043d\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0442\u0435\u0433\u0430 \u043a\u043e\u043c\u043c\u0438\u0442\u0430 \u0438 \u0432\u0440\u0435\u043c\u0435\u043d\u0438. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f deb-\u0444\u0430\u0439\u043b\u0430 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043b\u043e\u0433\u0438. \u041a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u0430\u0448 elf-\u0444\u0430\u0439\u043b \u0438\u0437 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u0430.<\/p>\n<p>\u0410 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0438\u0448\u0435\u043c \u0444\u0430\u0439\u043b\u044b, \u0431\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0430\u0448 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0436\u0438\u0437\u043d\u0435\u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d:<\/p>\n<p><em>\u0441ontrol<\/em>\u00a0&#8212; \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 deb-\u0444\u0430\u0439\u043b\u0430.<\/p>\n<p><em>service<\/em>\u00a0&#8212; \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435, \u0444\u0430\u0439\u043b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u043d\u043e\u0432\u0430\u043d deb-\u0444\u0430\u0439\u043b, \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u0430\u043d \u0434\u043e\u0441\u0442\u0443\u043f, \u0440\u0430\u0431\u043e\u0447\u0430\u044f \u043f\u0430\u043f\u043a\u0430 \u0438 \u0442.\u0434.<\/p>\n<p><em>postinst<\/em>\u00a0&#8212; \u043a\u043e\u043c\u0430\u043d\u0434\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u044b \u043f\u043e\u0441\u043b\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438, \u0432 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043f\u043a\u0438 \u043b\u043e\u0433\u043e\u0432, \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u0430\u043c\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0438\u0441\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043b\u043e\u0433 \u0441\u0431\u043e\u0440\u043a\u0438 \u0444\u0430\u0439\u043b\u0430.<\/p>\n<p>\u0412\u00a0artifacts\u00a0\u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 \u043e\u0434\u0438\u043d \u0434\u0435\u043d\u044c \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0444\u0430\u0439\u043b\u0430 \u0441 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435\u043c .deb.<\/p>\n<h2>7.\u00a0\u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u0435\u043c<\/h2>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 Nuitka \u043f\u0435\u0440\u0435\u0434 \u0435\u0435 \u0430\u043d\u0430\u043b\u043e\u0433\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a Pyinstaller \u0438 Docker. \u0412\u044b\u044f\u0441\u043d\u0438\u043b\u0438, \u043a\u0430\u043a\u0438\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Nuitka \u0432 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438, \u043a\u0430\u043a \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b\u044b \u043d\u0430 \u043c\u043e\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 Termidesk Assistant.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0443 \u0432\u0430\u0441 \u043e\u0441\u0442\u0430\u043b\u0438\u0441\u044c \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0432\u043e\u043f\u0440\u043e\u0441\u044b, \u043f\u0438\u0448\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445, \u0441 \u0440\u0430\u0434\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0432\u0435\u0447\u0443!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/872510\/\"> https:\/\/habr.com\/ru\/articles\/872510\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/p>\n<p>\u041c\u0435\u043d\u044f \u0437\u043e\u0432\u0443\u0442 \u0414\u0430\u043d\u0438\u043b, \u0438 \u044f \u0441\u0442\u0430\u0440\u0448\u0438\u0439 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0441\u0442 \u0432 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0423\u0432\u0435\u043e\u043d. \u0417\u0430\u043d\u0438\u043c\u0430\u044e\u0441\u044c \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e Termidesk Assistant &#8212; \u044d\u0442\u043e \u0443\u0442\u0438\u043b\u0438\u0442\u0430 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u044b\u0445 \u0440\u0430\u0431\u043e\u0447\u0438\u0445 \u0441\u0442\u043e\u043b\u043e\u0432.<\/p>\n<p>\u041a \u043d\u0430\u043c \u0432 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 \u043f\u0440\u0438\u0448\u043b\u0430 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0432\u0441\u044e \u0441\u0435\u0440\u0432\u0435\u0440\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c \u0432 \u043e\u0434\u0438\u043d \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (.elf) \u0438 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u0430 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043e\u0447\u043d\u044b\u0439 \u0444\u0430\u0439\u043b (.deb), \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0441\u0435\u0440\u0432\u0438\u0441.<\/p>\n<p>\u0412\u0441\u0435 \u044d\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438, \u0442\u0430\u043a \u0438 \u043f\u043e \u0432\u043d\u0435\u0448\u043d\u0438\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f Termidesk Assistant \u0432 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0441\u0435\u0442\u044f\u0445.<\/p>\n<p>\u041e Nuitka \u043c\u0430\u043b\u043e \u0447\u0442\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0432 Python-\u0441\u0440\u0435\u0434\u0435, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u0430\u043b\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043d\u0430 \u0440\u0443\u0441\u0441\u043a\u043e\u043c \u044f\u0437\u044b\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u0437\u044f\u0442\u044c\u0441\u044f \u0437\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0438 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u0442\u044c \u0432\u0441\u0451 \u0442\u043e, \u0447\u0442\u043e \u0443\u0441\u043f\u0435\u043b \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u0437\u0430 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043d\u0430\u0434 \u0437\u0430\u0434\u0430\u0447\u0435\u0439.<\/p>\n<h2>1.\u00a0\u00a0\u0427\u0442\u043e \u0436\u0435 \u0442\u0430\u043a\u043e\u0435 Nuitka?<\/h2>\n<p>Nuitka &#8212; \u0442\u0440\u0430\u043d\u0441\u043f\u0430\u0439\u043b\u0435\u0440 (\u0442\u0440\u0430\u043d\u0441\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0442\u0440\u0430\u043d\u0441\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434 Python \u0432 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438\u043b\u0438 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 C\/C++. \u0422\u043e \u0435\u0441\u0442\u044c \u043e\u043d \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u0434 Python \u0432 C++, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u044f \u0435\u0433\u043e, \u0430 \u0434\u0430\u043b\u0435\u0435 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0447\u0435\u0440\u0435\u0437 C++ \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440, \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0439 \u0444\u0430\u0439\u043b (elf, exe \u0438 \u0442.\u0434.)<\/p>\n<h2>2.\u00a0\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 Nuitka<\/h2>\n<p>\u041f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u0431\u043e\u0440\u043a\u0438 Django-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Nuitka, Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432 \u0438 PyInstaller, \u0443 Nuitka \u0435\u0441\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432:<\/p>\n<ol>\n<li>\n<p><strong>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/strong><br \/>Nuitka \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 Python-\u043a\u043e\u0434 \u0432 \u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u043c Python-\u043a\u043e\u0434\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p><strong>\u0420\u0430\u0437\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430<\/strong><br \/>Nuitka \u043e\u0431\u044b\u0447\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u0435\u043d\u044c\u0448\u0438\u0435 \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 PyInstaller, \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0417\u0430\u0449\u0438\u0442\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430<\/strong><br \/>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u044f\u0435\u0442 \u043e\u0431\u0440\u0430\u0442\u043d\u0443\u044e \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443, \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u044f \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0437\u0430\u0449\u0438\u0442\u0443 \u0432\u0430\u0448\u0435\u0433\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p><strong>\u041a\u0440\u043e\u0441\u0441\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c<\/strong><br \/>Nuitka \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/strong><br \/>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Docker, \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0438 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u041f\u041e \u043d\u0430 \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435.<\/p>\n<\/li>\n<\/ol>\n<h2>3.\u00a0\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438 Nuitka<\/h2>\n<ol>\n<li>\n<p><strong>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438<\/strong><br \/>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Nuitka \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Django \u0438 \u0432\u0441\u0435\u043c\u0438 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u0447\u0435\u043c \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Docker \u0438\u043b\u0438 PyInstaller.<\/p>\n<\/li>\n<li>\n<p><strong>\u0412\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438<\/strong><br \/>\u041f\u0440\u043e\u0446\u0435\u0441\u0441 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0441 Nuitka \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 Docker-\u043e\u0431\u0440\u0430\u0437\u0430 \u0438\u043b\u0438 \u0441\u0431\u043e\u0440\u043a\u0430 \u0441 PyInstaller.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u0432 Python<\/strong><br \/>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 Python (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043c\u043e\u0434\u0443\u043b\u0435\u0439) \u043c\u043e\u0433\u0443\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0435\u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e \u0438\u043b\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u043e\u0441\u0442\u0438<\/strong><br \/>\u041d\u0435 \u0432\u0441\u0435 Python-\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 Nuitka.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0442\u043b\u0430\u0434\u043a\u0430<\/strong><br \/>\u041e\u0442\u043b\u0430\u0436\u0438\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 (\u0434\u0435\u0431\u0430\u0433 \u0442\u0443\u0442 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u0435\u043d, \u0442\u043e\u043b\u044c\u043a\u043e print, \u0433\u0440\u0443\u0431\u043e \u0433\u043e\u0432\u043e\u0440\u044f), \u0447\u0435\u043c \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043a\u043e\u0434 \u0438\u043b\u0438 \u043a\u043e\u0434 \u0432 Docker-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f<\/strong><br \/>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0441\u043e\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u0441 Nuitka, \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043f\u043e\u043b\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u0441\u0431\u043e\u0440\u043a\u0438, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0441 Docker \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u043d\u0451\u043d\u043d\u044b\u0435 \u0441\u043b\u043e\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438<\/strong><br \/>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Docker, Nuitka \u043d\u0435 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043a \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0430\u043c \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u043c\u0438. \u0414\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0439 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 onefile, \u043d\u043e \u043e\u043d\u043e \u043d\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u044e \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u041e\u0421 \u0438 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0438 \u0434\u0440\u0430\u0439\u0432\u0435\u0440\u044b, \u043a\u0430\u043a \u044f \u044d\u0442\u043e \u043e\u0431\u0445\u043e\u0434\u0438\u043b &#8212; \u0447\u0443\u0442\u044c \u043f\u043e\u0437\u0436\u0435.<\/p>\n<\/li>\n<li>\n<p><strong>\u041c\u0435\u043d\u044c\u0448\u0435\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435<\/strong><br \/>Nuitka \u043c\u0435\u043d\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430 \u0432 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0435 Django \u0438 Python \u0432\u043e\u043e\u0431\u0449\u0435, \u0447\u0435\u043c Docker, \u0447\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0437\u0430\u0442\u0440\u0443\u0434\u043d\u0438\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0438 \u043b\u0443\u0447\u0448\u0438\u0445 \u043f\u0440\u0430\u043a\u0442\u0438\u043a. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u0437\u0434\u0435\u0441\u044c \ud83d\ude42<\/p>\n<\/li>\n<li>\n<p><strong>\u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u0430\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u0441\u0442\u044c<\/strong><br \/>Docker \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0433\u0438\u0431\u043a\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043c\u0438\u043a\u0440\u043e\u0441\u0435\u0440\u0432\u0438\u0441\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b.<\/p>\n<\/li>\n<\/ol>\n<h2>4.\u00a0\u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u0435\u043c: \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 Nuitka \u0441 Pyinstaller \u0438 Docker<\/h2>\n<p>Pyinstaller\u00a0\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u0430\u0445 \u043f\u0438\u0442\u043e\u043d\u043e\u0432\u0441\u043a\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u044b \u0438 \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0430\u0442\u043e\u0440, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a Nuitka \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u043a\u043e\u0434 \u0432 \u043c\u0430\u0448\u0438\u043d\u043d\u044b\u0439, \u0447\u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0432\u044b\u0448\u0430\u0435\u0442 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0437\u0430\u0449\u0438\u0442\u044b \u043a\u043e\u0434\u0430 \u043e\u0442 \u0447\u0442\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 Docker, Nuitka &#8212; \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0435 \u041f\u041e. \u042d\u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0443\u0432\u0435\u0440\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u0432 \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438 \u0443 \u043d\u0430\u0448\u0438\u0445 \u043a\u043b\u0438\u0435\u043d\u0442\u043e\u0432 \u0438 \u043c\u0435\u043d\u044c\u0448\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043e\u0431\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438.<\/p>\n<h2>5.\u00a0\u0421\u043f\u043e\u0441\u043e\u0431\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 Nuitka \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f<\/h2>\n<ol>\n<li>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 bash-\u0441\u043a\u0440\u0438\u043f\u0442\u0430\u0445<\/strong>&#8212; \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 shell-\u0441\u043a\u0440\u0438\u043f\u0442\u044b.- \u041f\u0440\u0438\u043c\u0435\u0440:&#171;`bash#!\/bin\/bashpython -m nuitka &#8212;follow-imports &#8212;standalone &#8212;output-dir=build myscript.py&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0432 CI\/CD \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b<\/strong>&#8212; GitFlic CI:&#171;`yaml<br \/>build_job:<br \/>script:<br \/>&#8212; pip install nuitka<br \/>&#8212; python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<br \/>&#171;`<br \/>&#8212; Jenkins:<br \/>&#171;`groovy<br \/>stage(&#8216;Build&#8217;) {<br \/>steps {<br \/>sh &#8216;pip install nuitka&#8217;<br \/>sh &#8216;python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py&#8217;<br \/>}<br \/>}<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 setup.py<\/strong>&#8212; \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f Nuitka \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u0430:<br \/>&#171;`python<br \/>from setuptools import setup<br \/>from nuitka.distutils_based_buildsystem.BuildSystem import Nuitka<\/p>\n<p>setup(<br \/>name=&#187;MyApp&#187;,<br \/>cmdclass={&#171;build_exe&#187;: Nuitka},<br \/># \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b&#8230;<br \/>)<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>GitHub Actions workflow<\/strong>&#8212; \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0430\u0446\u0438\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u0438 push \u0438\u043b\u0438 pull request:<br \/>&#171;`yaml<br \/>name: Build with Nuitka<br \/>on: [push, pull_request]<br \/>jobs:<br \/>build:<br \/>runs-on: ubuntu-latest<br \/>steps:<br \/>&#8212; uses: actions\/checkout@v2<br \/>&#8212; name: Set up Python<br \/>uses: actions\/setup-python@v2<br \/>&#8212; name: Install dependencies<br \/>run: |<br \/>pip install nuitka<br \/>&#8212; name: Build with Nuitka<br \/>run: python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>Makefile<\/strong>&#8212; \u0423\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0441\u0431\u043e\u0440\u043a\u0438:<br \/>&#171;`makefile<br \/>build:<br \/>python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<\/p>\n<p>clean:<br \/>rm -rf build\/<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>Docker<\/strong>&#8212; \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 Nuitka \u0432\u043d\u0443\u0442\u0440\u0438 Docker \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439:<br \/>&#171;`dockerfile<br \/>FROM python:3.9<br \/>RUN pip install nuitka<br \/>COPY . \/app<br \/>WORKDIR \/app<br \/>RUN python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>Tox<\/strong>&#8212; \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f Nuitka \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f:<br \/>&#171;`ini<br \/>[testenv:build]<br \/>deps = nuitka<br \/>commands = python -m nuitka &#8212;follow-imports &#8212;standalone myapp.py<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>Pre-commit hooks<\/strong>&#8212; \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043c\u0438\u0442\u043e\u043c:<br \/>&#171;`yaml<br \/>&#8212; repo: local<br \/>hooks:<br \/>&#8212; id: nuitka-build<br \/>name: Build with Nuitka<br \/>entry: python -m nuitka &#8212;follow-imports &#8212;standalone<br \/>language: system<br \/>files: ^myapp\\.py$<br \/>&#171;`<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0441 \u0441\u0438\u0441\u0442\u0435\u043c\u0430\u043c\u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438<\/strong>&#8212; \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0441\u0438\u0441\u0442\u0435\u043c \u0432\u0440\u043e\u0434\u0435 apt, yum \u0438\u043b\u0438 Homebrew \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c Nuitka \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438.<\/p>\n<\/li>\n<\/ol>\n<p>\u042d\u0442\u0438 \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c Nuitka \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0438 \u0440\u0430\u0437\u0432\u0435\u0440\u0442\u044b\u0432\u0430\u043d\u0438\u044f, \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u044f \u0441\u0431\u043e\u0440\u043a\u0443 \u0438 \u0434\u0435\u043b\u0430\u044f \u0435\u0451 \u0447\u0430\u0441\u0442\u044c\u044e \u0432\u0430\u0448\u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430. \u0412\u044b\u0431\u043e\u0440 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0430\u0448\u0435\u0439 \u0438\u043d\u0444\u0440\u0430\u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<h2>6.\u00a0\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435: \u043a\u043e\u0440\u043e\u0442\u043a\u043e \u043c\u043e\u0435\u043c \u043e\u043f\u044b\u0442\u0435<\/h2>\n<h3>6.1.\u00a0\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h3>\n<p>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438\u0437 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0435\u0434\u0438\u043d\u044b\u0439 \u043c\u043e\u043d\u043e\u043b\u0438\u0442. \u0415\u0441\u043b\u0438 \u0431\u0435\u0437 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e\u0441\u0442\u0435\u0439, \u044f \u0437\u0430\u043c\u0435\u043d\u0438\u043b Memcached \u043d\u0430 python-memcached \u0438 Redis \u043d\u0430 Fakeredis. \u0422\u0443\u0442 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0431\u0443\u0434\u0443, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0431\u0430\u043d\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u043b \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438. \u0414\u0430\u043b\u0435\u0435 \u0447\u0430\u0441\u0442\u044c \u0447\u0443\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u0435\u0435 &#8212; \u043f\u0440\u043e\u043a\u0441\u0438-\u0441\u0435\u0440\u0432\u0435\u0440. \u0423 \u043d\u0430\u0441 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u044b\u043b Apache2, \u0432 \u0441\u0432\u044f\u0437\u0438 \u0441 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a FastAPI, \u0435\u0441\u043b\u0438 \u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u044d\u043d\u0434\u043f\u043e\u0438\u043d\u0442\u044b, \u0442\u043e \u0432\u043e\u0442 \u043a\u043e\u0434:<br \/><strong>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432:<\/strong><\/p>\n<pre><code class=\"python\">def find_static_files():    if getattr(sys, 'frozen', False):        base_path = getattr(sys, '_MEIPASS', os.path.dirname(sys.executable))    else:        base_path = os.path.dirname(os.path.abspath(__file__))      possible_paths = [        os.path.join(base_path, 'static'),        os.path.join(base_path, 'django_termidesk_assistant', 'static'),        os.path.join(base_path, 'src', 'django_termidesk_assistant', 'static'),        os.path.join(os.path.dirname(base_path), 'static'),        '\/tmp\/onefile_*\/static'    ]      for path in possible_paths:        if '*' in path:            import glob            matching_paths = glob.glob(path)            if matching_paths:                return matching_paths[0]        elif os.path.exists(path) and os.path.isdir(path):            return path      print(\"Static files not found in any of the expected locations.\")    return None     def setup_static_files(app):    static_path = find_static_files()    if static_path:        if getattr(sys, 'frozen', False):            temp_dir = tempfile.mkdtemp()            temp_static_path = os.path.join(temp_dir, 'static')            shutil.copytree(static_path, temp_static_path)            static_path = temp_static_path          app.mount(\"\/assistant\/static\", StaticFiles(directory=static_path), name=\"static\")        return app    else:        print(\"Warning: Static files not found. Static content will not be served.\")        return None     fastapi_app = setup_static_files(fastapi_app)<\/code><\/pre>\n<p><strong>\u0420\u0435\u0434\u0438\u0440\u0435\u043a\u0442:<\/strong><\/p>\n<pre><code class=\"python\">@fastapi_app.exception_handler(404) async def custom_404_handler(request: Request, exc: Exception):    return RedirectResponse(url=\"\/assistant\/\")<\/code><\/pre>\n<p><strong>\u0413\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0432 \u0434\u043b\u044f https:<\/strong><\/p>\n<pre><code class=\"python\">def generate_ssl_certificates():    try:        subprocess.run(['openssl', 'genrsa', '-out', 'privkey.pem', '2048'], check=True)        subprocess.run(['openssl', 'req', '-new', '-x509', '-key', 'privkey.pem',                        '-out', 'fullchain.pem', '-days', '365', '-subj', \"\/CN=localhost\"], check=True)    except subprocess.CalledProcessError as e:        print(f\"Failed to generate SSL certificates: {e}\")        raise<\/code><\/pre>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a http \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/strong><\/p>\n<pre><code class=\"python\">def run_http_server():    config = Config(fastapi_app, host=\"0.0.0.0\", port=80)    server = Server(config=config)    try:        server.run()    except Exception as e:        print(f\"Server error on port 80: {e}\")<\/code><\/pre>\n<p><strong>\u0417\u0430\u043f\u0443\u0441\u043a https \u0441\u0435\u0440\u0432\u0435\u0440\u0430:<\/strong><\/p>\n<pre><code class=\"python\">def run_https_server():    generate_ssl_certificates()      certfile = \"fullchain.pem\"    keyfile = \"privkey.pem\"      config = Config(fastapi_app, host=\"0.0.0.0\", port=443,                    ssl_keyfile=keyfile, ssl_certfile=certfile)    server = Server(config=config)    try:        server.run()    except Exception as e:        print(f\"Server error on port 443: {e}\")<\/code><\/pre>\n<p><strong>\u0414\u0430\u043b\u044c\u0448\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430\u0445, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0431\u044b\u043b\u043e \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u043e\u0432 (\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u043b \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d &#8212; \u043d\u0435 \u0432\u044b\u0448\u043b\u043e):<\/strong><\/p>\n<pre><code class=\"python\">multiprocessing.freeze_support() http_process = multiprocessing.Process(target=run_http_server) https_process = multiprocessing.Process(target=run_https_server) daphne_process = multiprocessing.Process(target=run_daphne)   http_process.start() https_process.start() daphne_process.start()<\/code><\/pre>\n<p>run_daphne &#8212; \u0441\u043a\u0440\u0438\u043f\u0442 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e.<\/p>\n<h3>6.2.\u00a0GitFlic-\u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d\u044b, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441\u043e \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u0432 Nuitka<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0438\u0434\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u043d\u0430 CI\/CD \u0441\u0435\u0440\u0432\u0435\u0440\u0435.<\/p>\n<h4>6<\/h><\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-444842","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=444842"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/444842\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=444842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=444842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=444842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}