docker-compose up
sudo apt update && sudo apt upgrade -y
sudo apt install -y libcamera-apps python3-websockets python3-pip lsof fuser
pip3 install websockets
sudo touch /etc/systemd/system/sockets.service
Add the following content to the file:
[Unit]
Description=Socket Service
After=network.target
[Service]
ExecStart=/usr/bin/python3 /home/ssergienko/aibox/sockets.py
Restart=always
User=ssergienko
WorkingDirectory=/home/ssergienko/aibox
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=sockets
Environment=PYTHONUNBUFFERED=
[Install]
WantedBy=multi-user.target
sudo touch /etc/systemd/system/newton.service
Add the following content to the file:
[Unit]
Description=App Service
After=network.target
[Service]
ExecStart=/usr/bin/python3 /home/ssergienko/aibox/app.py
Restart=always
User=root
WorkingDirectory=/home/ssergienko/aibox
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=aibox
Environment=PYTHONUNBUFFERED=1
[Install]
WantedBy=multi-user.target
##service reload sudo systemctl daemon-reload
##Enable the services to start on boot:
sudo systemctl enable sockets.service
sudo systemctl enable aibox.service
##Start the services
sudo systemctl start sockets.service
sudo systemctl start aibox.service
##Check the Status
sudo systemctl status aibox.service
##You can view the logs for your services using journalctl
sudo journalctl -u aibox.service