Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhuchkouAA committed Nov 3, 2023
1 parent 4dffb86 commit a981b70
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18
FROM node:20
WORKDIR /var/www/5scontrol
COPY package.json .
RUN npm i
Expand Down
27 changes: 15 additions & 12 deletions t.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
const Docker = require('node-docker-api').Docker;
const docker = new Docker({socketPath: '/var/run/docker.sock'})
const json = {
"algorithm": "machine_control_js",
"camera": '102022222',
"start_tracking": 'date',
"stop_tracking": 'date',
"photos": [],
"violation_found": true,
"extra": {}
}
const body = JSON.stringify(json, null, 2)

const t = async () => {
const containers = await docker.container.list({all: true});
containers.forEach(c => {
if (c.data?.Names[0]?.includes('model')) {
container
}

})
}
t()
fetch('http://django-service:8000/api/reports/report-with-photos/', {
method: "POST",
headers: { 'Content-Type': 'application/json;charset=utf-8' },
body
})

0 comments on commit a981b70

Please sign in to comment.