Former-commit-id: 2a2debd5232729c7ce77544b40c9298e6bcabd2d
TangShanKaiPing
wanggang 5 years ago
parent 02f509eadd
commit b8be3a60f1

@ -1,21 +0,0 @@
1.nano /etc/rc.local
#https://linuxize.com/post/how-to-install-and-use-docker-compose-on-ubuntu-18-04/
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
#echo `date +"%Y-%m-%d %H:%M:%S"` > /root/start.log
exit 0
2.chmod +x /etc/rc.local

@ -8,6 +8,7 @@ using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Configuration;
using System;
namespace IoTNode
{
@ -77,8 +78,9 @@ namespace IoTNode
set.Add(new Setting { Name = "id", Value = macAddress.Md5(), Type = SettingType.Text });
set.Add(new Setting { Name = "code", Value = "根据id生成的授权码", Type = SettingType.Text });
//
var host = "localhost";
var stream = "localhost";
var host = this._cfg.GetValue("seed:host", "localhost");
var stream = this._cfg.GetValue("seed:stream", "localhost");
var delay = this._cfg.GetValue("seed:delay", "100");
set.Add(new Setting { Name = "debug", Value = "false" });
set.Add(new Setting { Name = "notify:enabled", Value = "true" });
set.Add(new Setting { Name = "notify:host", Value = $"http://{host}/IoTCenter" });
@ -91,7 +93,7 @@ namespace IoTNode
set.Add(new Setting { Name = "ffmpeg.args", Value = " -y -threads {0} -rtsp_transport tcp -use_wallclock_as_timestamps 1 -stimeout 3000000 -i \"{1}\" -fflags +genpts -c copy -f flv \"{2}\"" });
set.Add(new Setting { Name = "fbee.writelist", Value = "" });
set.Add(new Setting { Name = "camera.writelist", Value = "" });
set.Add(new Setting { Name = "delay", Value = "500", Type = SettingType.Text });
set.Add(new Setting { Name = "delay", Value = delay, Type = SettingType.Text });
db.SaveChanges();
var sn = macAddress;

@ -5,6 +5,9 @@
<li class="nav-item">
<a class="nav-link @GetClass("Scenes","Home")" href="@Url.Action("Scenes","Home")">场景</a>
</li>
<li class="nav-item">
<a class="nav-link @GetClass("Scenes","Home")" href="@Url.Content("~/job")">本地JobServer</a>
</li>
</ul>
@functions{
public string GetClass(string action, string controller)

@ -1,4 +1,4 @@
using System.Reflection;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0.527")]
[assembly: AssemblyInformationalVersion("1.0.0.529")]

@ -1,4 +1,5 @@
.vscode
.gitignore
log
docker\log\
docker\data\

@ -0,0 +1 @@
docker-compose up -d --remove-orphans

@ -1,4 +1,6 @@
version: "3.8"
networks:
default:
services:
portainer:
image: portainer/portainer:1.23.2

@ -4,8 +4,9 @@ su root
cd ~
#enable root ssh login
nano /etc/ssh/sshd_config
PermitRootLogin yes
#https://docs.docker.com/engine/install/ubuntu/
PermitRootLogin yes
service ssh restart
#docker install:https://docs.docker.com/engine/install/ubuntu/
apt-get remove docker docker-engine docker.io containerd runc
apt-get update
apt-get install \
@ -23,3 +24,14 @@ add-apt-repository \
apt-get update
apt-get install docker-ce docker-ce-cli containerd.io
docker run hello-world
#docker compose:https://docs.docker.com/compose/install/
curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
#publish
upload publish to /root/publish
#rc.local
nano /etc/rc.local
#!/bin/sh -e
/root/publish/start.sh
exit 0
reboot

@ -1 +1 @@
{"HttpHeaders":{"X-PortainerAgent-ManagerOperation":"1","X-PortainerAgent-PublicKey":"3059301306072a8648ce3d020106082a8648ce3d03010703420004fee75fb7c1d2c2f628be43b1c9d68925563b286d75699d0cfb64e96c2456e7d75517ab1da6469aacf2a647142de38bee207c4ef40c9f8418c2fdfa6b174c880c","X-PortainerAgent-Signature":"t8IScsZ5O2pjmxeV+7RFrpZpmiLvYgc7ew/WbL72QqRNALkiGuTr8MwCrzYRJNtkSXDYVUxyDhjfyqPYqz8UEw"}}
{"HttpHeaders":{"X-PortainerAgent-ManagerOperation":"1","X-PortainerAgent-PublicKey":"3059301306072a8648ce3d020106082a8648ce3d03010703420004fee75fb7c1d2c2f628be43b1c9d68925563b286d75699d0cfb64e96c2456e7d75517ab1da6469aacf2a647142de38bee207c4ef40c9f8418c2fdfa6b174c880c","X-PortainerAgent-Signature":"TEYfASo7Lvc5zDrjgE2dMeit4jSS/ZmHTTDf4Ipw6aBO7uFxBySP6o4TABOFkvGuAD85HQRimq/nPdBeRZWYqg"}}

@ -0,0 +1 @@
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
Loading…
Cancel
Save