Removed pm2
This commit is contained in:
+1
-3
@@ -10,8 +10,6 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY app/ ./
|
COPY app/ ./
|
||||||
|
|
||||||
RUN npm install pm2 -g
|
|
||||||
|
|
||||||
RUN chown -R node:node /app
|
RUN chown -R node:node /app
|
||||||
|
|
||||||
USER node
|
USER node
|
||||||
@@ -29,4 +27,4 @@ RUN npx tsc --noCheck
|
|||||||
|
|
||||||
HEALTHCHECK --interval=30s --start-period=10s --timeout=5s CMD wget -q --spider http://localhost:3000/share/healthcheck || exit 1
|
HEALTHCHECK --interval=30s --start-period=10s --timeout=5s CMD wget -q --spider http://localhost:3000/share/healthcheck || exit 1
|
||||||
|
|
||||||
CMD ["pm2-runtime", "dist/index.js" ]
|
CMD ["node", "dist/index.js" ]
|
||||||
|
|||||||
@@ -184,6 +184,17 @@ For example, to disable the download button for images, you would edit the `ligh
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Customising your error response pages
|
||||||
|
|
||||||
|
You can customise the responses that IPP sends for invalid requests. For example you could:
|
||||||
|
|
||||||
|
- Drop the connection entirely (no response).
|
||||||
|
- Redirect to a new website.
|
||||||
|
- Send a different status code.
|
||||||
|
- And so on...
|
||||||
|
|
||||||
|
See [Custom responses](docs/custom-responses.md) for more details.
|
||||||
|
|
||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
If you're using Cloudflare and having issues with videos not playing well, make sure your `/share/video/` paths are set to bypass cache.
|
If you're using Cloudflare and having issues with videos not playing well, make sure your `/share/video/` paths are set to bypass cache.
|
||||||
|
|||||||
+1
-1
@@ -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 --build-arg PACKAGE_VERSION=$(npm pkg get version | xargs) --format docker -t immich-proxy-test .. && podman run --init -it -p=3000:3000 --env-file .env immich-proxy-test",
|
"test": "podman build --build-arg PACKAGE_VERSION=$(npm pkg get version | xargs) --format docker -t immich-proxy-test .. && podman run --init -it -p=3000:3000 --env-file .env --restart=always immich-proxy-test",
|
||||||
"start": "node dist/index.js"
|
"start": "node dist/index.js"
|
||||||
},
|
},
|
||||||
"author": "Alan Grainger",
|
"author": "Alan Grainger",
|
||||||
|
|||||||
+20
-1
@@ -66,6 +66,7 @@ const decodeCookie = (req: Request, _res: Response, next: NextFunction) => {
|
|||||||
app.get(/^(|\/share)\/healthcheck$/, async (_req, res) => {
|
app.get(/^(|\/share)\/healthcheck$/, async (_req, res) => {
|
||||||
if (await immich.accessible()) {
|
if (await immich.accessible()) {
|
||||||
res.send('ok')
|
res.send('ok')
|
||||||
|
throw new Error('asdf')
|
||||||
} else {
|
} else {
|
||||||
res.status(503).send()
|
res.status(503).send()
|
||||||
}
|
}
|
||||||
@@ -164,8 +165,26 @@ app.get('*', (req, res) => {
|
|||||||
respondToInvalidRequest(res, 404)
|
respondToInvalidRequest(res, 404)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Send the correct process error code for any uncaught exceptions
|
||||||
|
// so that Docker can gracefully restart the container
|
||||||
|
process.on('uncaughtException', (err) => {
|
||||||
|
console.error('There was an uncaught error', err)
|
||||||
|
server.close()
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
process.on('unhandledRejection', (reason, promise) => {
|
||||||
|
console.error('Unhandled Rejection at:', promise, 'reason:', reason)
|
||||||
|
server.close()
|
||||||
|
process.exit(1)
|
||||||
|
})
|
||||||
|
process.on('SIGTERM', () => {
|
||||||
|
console.log('Received SIGTERM. Gracefully shutting down...')
|
||||||
|
server.close()
|
||||||
|
process.exit(0)
|
||||||
|
})
|
||||||
|
|
||||||
// Start the ExpressJS server
|
// Start the ExpressJS server
|
||||||
const port = process.env.IPP_PORT || 3000
|
const port = process.env.IPP_PORT || 3000
|
||||||
app.listen(port, () => {
|
const server = app.listen(port, () => {
|
||||||
console.log(dayjs().format() + ' Server started on port ' + port)
|
console.log(dayjs().format() + ' Server started on port ' + port)
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user