From 28ca523d9cddd6aa54e0e422171d1864aac10de5 Mon Sep 17 00:00:00 2001 From: Vladimir Kutkovoy Date: Sat, 15 Feb 2025 19:15:48 +0000 Subject: [PATCH] fix started for container --- .drone.yml | 2 +- Docker-api | 5 ++++- main.js | 3 +-- package.json | 17 ++++++++++++++++- 4 files changed, 22 insertions(+), 5 deletions(-) diff --git a/.drone.yml b/.drone.yml index 56c8c27..73c411e 100644 --- a/.drone.yml +++ b/.drone.yml @@ -9,7 +9,7 @@ steps: dockerfile: ./Docker-api tags: - latest - repo: 192.168.0.129:5000/trash-api1 + repo: 192.168.0.129:5000/trash-api registry: 192.168.0.129:5000 insecure: true diff --git a/Docker-api b/Docker-api index a0ac207..58648aa 100644 --- a/Docker-api +++ b/Docker-api @@ -8,4 +8,7 @@ COPY package*.json ./ RUN npm ci COPY . . -EXPOSE 3001/tcp \ No newline at end of file +RUN npm run build + +EXPOSE 3001/tcp +CMD npm start \ No newline at end of file diff --git a/main.js b/main.js index 0ad9ee9..f598ba5 100644 --- a/main.js +++ b/main.js @@ -2,7 +2,7 @@ const express = require('express') const util = require('util'); const bodyParser = require('body-parser'); const app = express() -const PORT = 3333; +const PORT = 3001; app.use(bodyParser.urlencoded({ extended: true })); app.use(express.json()) @@ -26,7 +26,6 @@ app.get('/', (req, res) => { res.send('OK') }) - app.listen(PORT, () => { console.log(`Start on http://localhost:${PORT}`); }) \ No newline at end of file diff --git a/package.json b/package.json index 3a4c891..273e016 100644 --- a/package.json +++ b/package.json @@ -3,5 +3,20 @@ "body-parser": "^1.20.3", "express": "^4.21.2", "util": "^0.12.5" - } + }, + "name": "trash-api", + "description": "Датчик наполнения мусорных контейнеров. Система позволяет пользователю получить информацию о наполненности мусорных контейнеров. Тем самым помогает ему решить задачи оптимизации и эффективности предоставления услуг по управлению отходами.", + "version": "1.0.0", + "main": "main.js", + "devDependencies": {}, + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node main.js" + }, + "repository": { + "type": "git", + "url": "https://git.vladimirkutkovoy.ru/vladimirkutkovoy/TrashAdmin.git" + }, + "author": "", + "license": "ISC" }