部署牧安云哨
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
# 使用官方 Python 镜像
|
||||||
|
FROM python:3.10-slim
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
libpq5 \
|
||||||
|
unixodbc \
|
||||||
|
curl \
|
||||||
|
fonts-wqy-zenhei \
|
||||||
|
libgl1 \
|
||||||
|
gnupg \
|
||||||
|
apt-transport-https \
|
||||||
|
lsb-release && \
|
||||||
|
# 导入微软 GPG key(使用 keyrings 方式)
|
||||||
|
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > /usr/share/keyrings/microsoft.gpg && \
|
||||||
|
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft.gpg] https://packages.microsoft.com/ubuntu/22.04/prod jammy main" > /etc/apt/sources.list.d/mssql-release.list && \
|
||||||
|
apt-get update && \
|
||||||
|
ACCEPT_EULA=Y apt-get install -y msodbcsql18 && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY app/requirements.txt .
|
||||||
|
# 安装 Python 依赖
|
||||||
|
RUN pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple -r requirements.txt
|
||||||
|
RUN python -m pip uninstall -y opencv-python
|
||||||
|
RUN python -m pip install opencv-python-headless
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# 复制并解压 JRE
|
||||||
|
COPY docker/OpenJDK17U-jre_x64_linux_hotspot_17.0.16_8.tar.gz /opt/
|
||||||
|
RUN tar -xzf /opt/OpenJDK17U-jre_x64_linux_hotspot_17.0.16_8.tar.gz -C /opt/ && \
|
||||||
|
rm /opt/OpenJDK17U-jre_x64_linux_hotspot_17.0.16_8.tar.gz
|
||||||
|
|
||||||
|
# 配置 Java 环境
|
||||||
|
ENV JAVA_HOME=/opt/jdk-17.0.16+8-jre
|
||||||
|
ENV PATH="$JAVA_HOME/bin:$PATH"
|
||||||
|
|
||||||
|
# 复制项目代码
|
||||||
|
COPY app/ .
|
||||||
|
# 复制 pyzxing 的 jar 文件到默认路径
|
||||||
|
COPY docker/javase-3.4.1-SNAPSHOT-jar-with-dependencies.jar /root/.local/pyzxing/javase-3.4.1-SNAPSHOT-jar-with-dependencies.jar
|
||||||
|
|
||||||
|
EXPOSE 13011
|
||||||
|
|
||||||
|
# 启动命令(使用 uvicorn 启动 FastAPI)
|
||||||
|
CMD ["python", "app.py"]
|
||||||
|
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ func main() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
// 个人业务
|
// 个人业务
|
||||||
//test()
|
test()
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -170,13 +170,13 @@ export function useColumns<T = SystemUserApi.SystemUser>(
|
|||||||
field: 'online',
|
field: 'online',
|
||||||
slots: { default: 'status' },
|
slots: { default: 'status' },
|
||||||
title: '当前状态',
|
title: '当前状态',
|
||||||
width: 100,
|
width: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'device_type',
|
field: 'device_type',
|
||||||
slots: { default: 'deviceType' },
|
slots: { default: 'deviceType' },
|
||||||
title: '设备类型',
|
title: '设备类型',
|
||||||
width: 100,
|
width: 80,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'dept_name',
|
field: 'dept_name',
|
||||||
@@ -192,15 +192,6 @@ export function useColumns<T = SystemUserApi.SystemUser>(
|
|||||||
title: '可用性',
|
title: '可用性',
|
||||||
width: 100,
|
width: 100,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
cellRender: {
|
|
||||||
attrs: { beforeChange: onIsSuperUserChange },
|
|
||||||
name: onIsSuperUserChange ? 'CellSwitch' : 'CellTag',
|
|
||||||
},
|
|
||||||
field: 'is_superuser',
|
|
||||||
title: '管理员',
|
|
||||||
width: 100,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
field: 'remark',
|
field: 'remark',
|
||||||
title: '备注',
|
title: '备注',
|
||||||
@@ -256,6 +247,15 @@ export function useColumns<T = SystemUserApi.SystemUser>(
|
|||||||
title: '创建时间',
|
title: '创建时间',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
cellRender: {
|
||||||
|
attrs: { beforeChange: onIsSuperUserChange },
|
||||||
|
name: onIsSuperUserChange ? 'CellSwitch' : 'CellTag',
|
||||||
|
},
|
||||||
|
field: 'is_superuser',
|
||||||
|
title: '管理员',
|
||||||
|
width: 100,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'operation',
|
field: 'operation',
|
||||||
title: '操作',
|
title: '操作',
|
||||||
|
|||||||
@@ -202,8 +202,8 @@ let ws: null | WebSocket = null;
|
|||||||
|
|
||||||
function createWs(token: string) {
|
function createWs(token: string) {
|
||||||
ws = new WebSocket(
|
ws = new WebSocket(
|
||||||
// `wss://ai.ronsunny.cn:8090/ai/iot/ws/device-status?token=${token}`,
|
`wss://ai.ronsunny.cn:8090/ai/iot/ws/device-status?token=${token}`,
|
||||||
`ws://127.0.0.1:13011/iot/ws/device-status?token=${token}`,
|
// `ws://127.0.0.1:13011/iot/ws/device-status?token=${token}`,
|
||||||
);
|
);
|
||||||
wsState.ws = ws;
|
wsState.ws = ws;
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ function createWs(token: string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ws = new WebSocket(
|
ws = new WebSocket(
|
||||||
`ws://127.0.0.1:13011/iot/ws/sentinel_record?token=${token}`,
|
// `ws://127.0.0.1:13011/iot/ws/sentinel_record?token=${token}`,
|
||||||
|
`wss://ai.ronsunny.cn:8090/ai/iot/ws/sentinel_record?token=${token}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
ws.onmessage = (e) => {
|
ws.onmessage = (e) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user