1st Versionwith nginx, gunicorn and flask

This commit is contained in:
2024-03-11 11:56:30 +01:00
commit fcaa0d5d72
35 changed files with 1322 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
[Unit]
Description=gunicorn daemon for vrpmdv_setup_page
Requires=vrpmdv_setup_page.socket
After=network.target
[Service]
User=root
Group=www-data
Type=notify
RuntimeDirectory=gunicorn
WorkingDirectory=/var/www/vrpmdv-setup.local/
ExecStart=/usr/bin/gunicorn vrmpdvsetupapp
ExecReload=/bin/kill -s HUP $MAINPID
KillMode=mixed
TimeoutStopSec=5
PrivateTmp=true
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,9 @@
[Unit]
Description=gunicorn socket for vrpmdv_setup_page
[Socket]
ListenStream=/run/vrpmdv_setup_page.sock
SocketUser=www
[Install]
WantedBy=sockets.target

View File

@@ -0,0 +1,35 @@
SUMMARY = "Install and start a systemd services"
SECTION = "mlgunicorn"
LICENSE = "CLOSED"
inherit systemd
FILESEXTRAPATHS:prepend := "${THISDIR}/files:"
SRC_URI += "file://vrpmdv_setup_page.service"
SRC_URI += "file://vrpmdv_setup_page.socket"
SYSTEMD_AUTO_ENABLE = "enable"
SYSTEMD_SERVICE:${PN} = "vrpmdv_setup_page.service vrpmdv_setup_page.socket "
FILES:${PN} += "${systemd_system_unitdir}"
FILES:${PN} += "${systemd_system_unitdir}/vrpmdv_setup_page.service"
FILES:${PN} += "${systemd_system_unitdir}/vrpmdv_setup_page.socket"
do_install:append () {
install -d ${D}/${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/vrpmdv_setup_page.service ${D}/${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/vrpmdv_setup_page.socket ${D}/${systemd_system_unitdir}
install -d ${D}${sysconfdir}/systemd/system/multi-user.target.wants/
install -d ${D}${sysconfdir}/systemd/system/sockets.target.wants/
ln -s ${systemd_system_unitdir}/datalogger_setup_page.socket ${D}${sysconfdir}/systemd/system/sockets.target.wants/vrpmdv_setup_page.socket
ln -s ${systemd_system_unitdir}/datalogger_setup_page.service ${D}${sysconfdir}/systemd/system/multi-user.target.wants/vrpmdv_setup_page.service
}
REQUIRED_DISTRO_FEATURES= "systemd"