diff --git a/server/Dockerfile b/server/Dockerfile index 0e99fa8..a56edb2 100644 --- a/server/Dockerfile +++ b/server/Dockerfile @@ -1,13 +1,15 @@ FROM node:latest -WORKDIR /usr/src/app +WORKDIR /usr/src/anchiale COPY package*.json ./ -RUN npm install +RUN npm install && npm install typescript -g COPY . . EXPOSE 3000 -ENTRYPOINT npm run start +RUN tsc + +CMD ["node", "./build/index.js"] \ No newline at end of file diff --git a/server/server.sh b/server/server.sh index bf11da1..4212fb6 100644 --- a/server/server.sh +++ b/server/server.sh @@ -1,2 +1,2 @@ docker build -t xrazis/server . -docker run -d -p 3000:3000 xrazis/server \ No newline at end of file +docker run -d -p 8087:3000 xrazis/server \ No newline at end of file diff --git a/server/src/class/Database.ts b/server/src/class/Database.ts index bb04a71..1e6b413 100644 --- a/server/src/class/Database.ts +++ b/server/src/class/Database.ts @@ -24,14 +24,13 @@ export class Database { process.env.DB_ORG!, process.env.DB_BUCKET! ); - this.writeApi.useDefaultTags({ host: 'local' }); this.queryApi = this.client.getQueryApi(process.env.DB_ORG!); } - write(uuid: string, value: number, pointName: string) { + write(uuid: string, measurement: number, pointName: string) { const point = new Point(pointName) .tag('client', uuid) - .floatField('value', value); + .floatField('value', measurement); this.writeApi.writePoint(point); this.writeApi.flush(); }