-
I am using DigitalOcean's App platform to deploy the latest Docker image. Is there a way to cleanly restart the node.js kutt app without restarting the deployment? I'm trying to import/download the customizations to the /kutt/custom folder post-deployment without restarting the deployment and wiping ephemeral storage in the process. I'm using an external database so if I can avoid using a Droplet I will. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can probably just mount the volume to something I think? OR just make your own image based on it? I'm not that familiar with DigitalOcean or Docker |
Beta Was this translation helpful? Give feedback.
-
Running Kutt in dev mode would cause it to restart by itself when there are changes in custom/ (as well as other code files), but it's not particularly recommended. npm start will actually hang the caller until the server exits, so having something like npm restart would require more signaling machinery than what is currently implemented. |
Beta Was this translation helpful? Give feedback.
I took a minute and stuck my nose deeper into DigitalOcean's slightly lackluster documentation for the App Platform. Looks like in their YAML app spec,
run_command
overrides the dockerfile's CMD, (similar toentrypoint
), so I was able to do the following:run_command: sh -c "apk --no-cache add git && rm -rf /kutt/custom && git clone https://github.com/mycompany/mytheme.git /kutt/custom && npm run migrate && npm start"
A couple comments for anyone interested: I noticed that whatever was following
run_command
in DO's was not being parsed/processed like the shell would, so I found it necessary to usesh -c
. Finally, I just tacked on the CMD from the dockerfile to finish things off, (since th…