1
0
Fork 0
mirror of https://github.com/alangrainger/immich-public-proxy.git synced 2024-12-28 20:01:57 +00:00

Consolidate app files

This commit is contained in:
Alan Grainger 2024-11-02 22:18:04 +01:00
parent 12064d740f
commit 69d88fa849
32 changed files with 15 additions and 13 deletions

9
.gitignore vendored
View file

@ -1,5 +1,6 @@
/node_modules/ node_modules/
/dist/ dist/
/.idea/ .idea
.env .env
/package-lock.json .directory
package-lock.json

View file

@ -2,11 +2,12 @@ FROM node:lts-slim
WORKDIR /app WORKDIR /app
COPY package.json ./ COPY app/package.json ./
RUN npm install --omit=dev RUN npm install --omit=dev
RUN npm install pm2 -g
COPY . . COPY app/ ./
ENV NODE_ENV=production ENV NODE_ENV=production
@ -14,4 +15,8 @@ ENV NODE_ENV=production
# dev-dependencies above to save space in the final build # dev-dependencies above to save space in the final build
RUN npx tsc --noCheck RUN npx tsc --noCheck
CMD [ "node", "dist/index.js" ] RUN chown -R node:node /app
USER node
CMD ["pm2-runtime", "dist/index.js" ]

View file

@ -4,7 +4,7 @@
"scripts": { "scripts": {
"dev": "ts-node src/index.ts", "dev": "ts-node src/index.ts",
"build": "npx tsc", "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" "start": "node dist/index.js"
}, },
"author": "Alan Grainger", "author": "Alan Grainger",

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

@ -89,10 +89,6 @@ const toString = (value: unknown) => {
return typeof value === 'string' ? value : '' 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, () => { app.listen(3000, () => {
console.log(dayjs().format() + ' Server started') console.log(dayjs().format() + ' Server started')
}) })