From 8617feeeb28d2475cf6f636f81b250b53fd8e6e5 Mon Sep 17 00:00:00 2001 From: Fahad Faruqi Date: Mon, 18 Nov 2024 21:44:15 -0500 Subject: [PATCH] converting to npm app --- Dockerfile | 8 ++++---- package-lock.json | 43 ++++++++++++++++++++----------------------- package.json | 13 +++++++++---- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/Dockerfile b/Dockerfile index f987ca2..80e2209 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,13 @@ -FROM oven/bun:1 AS base +FROM node:18-alpine AS base WORKDIR /app -COPY package.json ./ +COPY package.json package-lock.json ./ -RUN bun install +RUN npm install --no-cache COPY . . EXPOSE 3000 -CMD [ "bun", "run", "server.ts" ] \ No newline at end of file +CMD ["npm", "run", "serve"] diff --git a/package-lock.json b/package-lock.json index 6476fff..d0a51c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,12 +17,15 @@ "cors": "^2.8.5", "dotenv": "^16.4.5", "express": "^4.19.2", - "fs": "^0.0.1-security", "nodemon": "^3.1.1", "path": "^0.12.7", - "pg": "^8.11.5", + "pg": "^8.13.1", "ts-node": "^10.9.2", + "typescript": "^5.6.3", "winston": "^3.13.0" + }, + "devDependencies": { + "typescript": "^5.2.2" } }, "node_modules/@colors/colors": { @@ -888,11 +891,6 @@ "node": ">= 0.6" } }, - "node_modules/fs": { - "version": "0.0.1-security", - "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", - "integrity": "sha512-3XY9e1pP0CVEUCdj5BmfIZxRBTSDycnbqhIOGec9QYtmVH2fbLpj86CFWkrNOkt/Fvty4KZG5lTglL9j/gJ87w==" - }, "node_modules/fsevents": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", @@ -1388,13 +1386,13 @@ } }, "node_modules/pg": { - "version": "8.11.5", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.11.5.tgz", - "integrity": "sha512-jqgNHSKL5cbDjFlHyYsCXmQDrfIX/3RsNwYqpd4N0Kt8niLuNoRNH+aazv6cOd43gPh9Y4DjQCtb+X0MH0Hvnw==", + "version": "8.13.1", + "resolved": "https://registry.npmjs.org/pg/-/pg-8.13.1.tgz", + "integrity": "sha512-OUir1A0rPNZlX//c7ksiu7crsGZTKSOXJPgtNiHGIlC9H0lO+NC6ZDYksSgBYY/thSWhnSRBv8w1lieNNGATNQ==", "dependencies": { - "pg-connection-string": "^2.6.4", - "pg-pool": "^3.6.2", - "pg-protocol": "^1.6.1", + "pg-connection-string": "^2.7.0", + "pg-pool": "^3.7.0", + "pg-protocol": "^1.7.0", "pg-types": "^2.1.0", "pgpass": "1.x" }, @@ -1420,9 +1418,9 @@ "optional": true }, "node_modules/pg-connection-string": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.4.tgz", - "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==" + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.7.0.tgz", + "integrity": "sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==" }, "node_modules/pg-int8": { "version": "1.0.1", @@ -1441,17 +1439,17 @@ } }, "node_modules/pg-pool": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.6.2.tgz", - "integrity": "sha512-Htjbg8BlwXqSBQ9V8Vjtc+vzf/6fVUuak/3/XXKA9oxZprwW3IMDQTGHP+KDmVL7rtd+R1QjbnCFPuTHm3G4hg==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.7.0.tgz", + "integrity": "sha512-ZOBQForurqh4zZWjrgSwwAtzJ7QiRX0ovFkZr2klsen3Nm0aoh33Ls0fzfv3imeH/nw/O27cjdz5kzYJfeGp/g==", "peerDependencies": { "pg": ">=8.0" } }, "node_modules/pg-protocol": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.6.1.tgz", - "integrity": "sha512-jPIlvgoD63hrEuihvIg+tJhoGjUsLPn6poJY9N5CnlPd91c2T18T/9zBtLxZSb1EhYxBRoZJtzScCaWlYLtktg==" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.7.0.tgz", + "integrity": "sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ==" }, "node_modules/pg-types": { "version": "4.0.2", @@ -2000,7 +1998,6 @@ "version": "5.4.5", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" diff --git a/package.json b/package.json index 76d3baa..590b7a6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,9 @@ { "scripts": { "test": "mocha --recursive", - "serve": "bun run --watch server.ts" + "build": "tsc", + "serve": "nodemon --watch server.ts", + "start": "node dist/server.js" }, "dependencies": { "@types/chai": "^4.3.16", @@ -16,11 +18,14 @@ "cors": "^2.8.5", "dotenv": "^16.4.5", "express": "^4.19.2", - "fs": "^0.0.1-security", "nodemon": "^3.1.1", "path": "^0.12.7", - "pg": "^8.11.5", + "pg": "^8.13.1", "ts-node": "^10.9.2", + "typescript": "^5.6.3", "winston": "^3.13.0" + }, + "devDependencies": { + "typescript": "^5.2.2" } -} \ No newline at end of file +}