dont watch for prod env

This commit is contained in:
Jurgis Sakalauskas
2023-11-25 10:54:45 +02:00
parent 995ad4c28f
commit cf9da2d4f7
7 changed files with 28 additions and 10 deletions
+1
View File
@@ -1 +1,2 @@
PORT=3000
NODE_ENV=development
+1 -8
View File
@@ -1,15 +1,8 @@
FROM node:18
#install calibre
RUN apt-get update -y
RUN apt-get install -y libopengl0
RUN apt-get install -y libegl1
RUN wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin
WORKDIR /srv/app
COPY ./ /srv/app
RUN npm install
EXPOSE $PORT
CMD ["npm", "run", "dev"]
CMD ["npm", "run", "start"]
+1 -1
View File
@@ -1,5 +1,5 @@
{
"name": "kobo",
"name": "app",
"lockfileVersion": 2,
"requires": true,
"packages": {
+3 -1
View File
@@ -15,7 +15,9 @@
"prepare": "npm run compile",
"pretest": "npm run compile",
"posttest": "npm run lint",
"dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts"
"dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
"prod": "ts-node src/index.ts",
"start": "bash ./start.sh"
},
"dependencies": {
"@extractus/article-extractor": "^7.3.1",
+1
View File
@@ -6,6 +6,7 @@ interface Article {
title: string;
dateAdded: string;
uid: string;
url: string;
}
class ArticlesRepository {
+1
View File
@@ -32,6 +32,7 @@ addArticleRouter.get('/', (req, res) => {
uid: hash,
title: article.title ?? 'no title',
dateAdded: new Date().toISOString().split('T')[0],
url,
});
mkdir(dir, {recursive: true}, (err) => {
+20
View File
@@ -0,0 +1,20 @@
#!/bin/bash
# install calibre
echo "Installing calibre"
apt-get update -y
apt-get install -y libopengl0
apt-get install -y libegl1
wget -nv -O- https://download.calibre-ebook.com/linux-installer.sh | sh /dev/stdin
# npm install
echo "Installing dependencies"
npm install
if [ "$NODE_ENV" == "production" ]; then
echo "Running prod"
npm run prod
else
echo "Running dev"
npm run dev
fi