mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-16 01:41:29 +03:00
Switched nodemon to foreverjs to hopefully enable restarting internally and fix runtime errors
This commit is contained in:
@@ -35,6 +35,7 @@ RUN apk add --no-cache \
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY --chown=$UID:$GID [ "backend/package.json", "backend/package-lock.json", "/app/" ]
|
COPY --chown=$UID:$GID [ "backend/package.json", "backend/package-lock.json", "/app/" ]
|
||||||
|
RUN npm install forever -g
|
||||||
RUN npm install && chown -R $UID:$GID ./
|
RUN npm install && chown -R $UID:$GID ./
|
||||||
|
|
||||||
COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ]
|
COPY --chown=$UID:$GID --from=frontend [ "/build/backend/public/", "/app/public/" ]
|
||||||
@@ -42,4 +43,4 @@ COPY --chown=$UID:$GID [ "/backend/", "/app/" ]
|
|||||||
|
|
||||||
EXPOSE 17442
|
EXPOSE 17442
|
||||||
ENTRYPOINT [ "/app/entrypoint.sh" ]
|
ENTRYPOINT [ "/app/entrypoint.sh" ]
|
||||||
CMD [ "nodemon", "app.js" ]
|
CMD [ "forever", "app.js" ]
|
||||||
|
|||||||
@@ -335,18 +335,11 @@ async function startServer() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function restartServer(is_update = false) {
|
async function restartServer(is_update = false) {
|
||||||
const restartProcess = () => {
|
|
||||||
spawn('node', ['app.js'], {
|
|
||||||
detached: true,
|
|
||||||
stdio: 'inherit'
|
|
||||||
}).unref()
|
|
||||||
process.exit()
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info(`${is_update ? 'Update complete! ' : ''}Restarting server...`);
|
logger.info(`${is_update ? 'Update complete! ' : ''}Restarting server...`);
|
||||||
|
|
||||||
// the following line restarts the server through nodemon
|
// the following line restarts the server through nodemon
|
||||||
fs.writeFileSync(`restart${is_update ? '_update' : '_general'}.json`, 'internal use only');
|
fs.writeFileSync(`restart${is_update ? '_update' : '_general'}.json`, 'internal use only');
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateServer(tag) {
|
async function updateServer(tag) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
CMD="nodemon app.js"
|
CMD="forever app.js"
|
||||||
|
|
||||||
# if the first arg starts with "-" pass it to program
|
# if the first arg starts with "-" pass it to program
|
||||||
if [ "${1#-}" != "$1" ]; then
|
if [ "${1#-}" != "$1" ]; then
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
"description": "backend for YoutubeDL-Material",
|
"description": "backend for YoutubeDL-Material",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"preinstall": "npm i nodemon -g",
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
"start": "nodemon app.js"
|
"start": "nodemon app.js"
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user