Consolidate app files
9
.gitignore
vendored
|
@ -1,5 +1,6 @@
|
|||
/node_modules/
|
||||
/dist/
|
||||
/.idea/
|
||||
node_modules/
|
||||
dist/
|
||||
.idea
|
||||
.env
|
||||
/package-lock.json
|
||||
.directory
|
||||
package-lock.json
|
||||
|
|
11
Dockerfile
|
@ -2,11 +2,12 @@ FROM node:lts-slim
|
|||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json ./
|
||||
COPY app/package.json ./
|
||||
|
||||
RUN npm install --omit=dev
|
||||
RUN npm install pm2 -g
|
||||
|
||||
COPY . .
|
||||
COPY app/ ./
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
|
@ -14,4 +15,8 @@ ENV NODE_ENV=production
|
|||
# dev-dependencies above to save space in the final build
|
||||
RUN npx tsc --noCheck
|
||||
|
||||
CMD [ "node", "dist/index.js" ]
|
||||
RUN chown -R node:node /app
|
||||
|
||||
USER node
|
||||
|
||||
CMD ["pm2-runtime", "dist/index.js" ]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"scripts": {
|
||||
"dev": "ts-node src/index.ts",
|
||||
"build": "npx tsc",
|
||||
"test": "podman build -t immich-proxy-test . && podman run --init -it -p=3000:3000 immich-proxy-test",
|
||||
"test": "podman build -t immich-proxy-test .. && podman run --init -it -p=3000:3000 --env-file .env immich-proxy-test",
|
||||
"start": "node dist/index.js"
|
||||
},
|
||||
"author": "Alan Grainger",
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
@ -89,10 +89,6 @@ const toString = (value: unknown) => {
|
|||
return typeof value === 'string' ? value : ''
|
||||
}
|
||||
|
||||
// Handle process termination requests (e.g. Ctrl+C)
|
||||
process.on('SIGTERM', () => { process.exit(0) })
|
||||
process.on('SIGINT', () => { process.exit(0) })
|
||||
|
||||
app.listen(3000, () => {
|
||||
console.log(dayjs().format() + ' Server started')
|
||||
})
|