Improve docker, dev, and user experience
Saw your post in r/selfhosted. I have experience with node-based, web applications written to be deployed with docker so I thought I'd give some suggestions on how to setup your project for more painless experience for both you and your users.
If you have any questions about these changes I'm happy to expand on why I made them or what they do.
P.S. did not include this in the PR because its an opinionated approach (and a bit of self-advertising) but you may want to check out my logging library https://foxxmd.github.io/logging . It's an easy way to set up powerful logging usable for both you and your users and would be useful once you need more than the basic node console logging.
To use the github actions workflow to deploy automatically to dockerhub and github packages
Triggers on these actions and publishes accordingly:
- On commit to
mainbranch => published to dockerhub/ghcrlatesttag - On commit to
experimentalbranch => published to dockerhub/ghcrexperimentaltag - On release => published to dockerhub/ghcr using release
tag
To enable
- Go to repository settings -> secrets and variables -> actions
- Add repository secrets
-
DOCKER_USERNAME- your dockerhub username -
DOCKER_PASSWORD- your dockerhub password
-
- Add repository variables
-
DOCKERHUB_IMAGE_NAME- the full name of the dockerhub image IEdavidguva/openvidreview -
GHCR_IMAGE_NAME- the full name of the GHCR image IEghcr.io/davidguva/openvidreview - If neither of the above variables are included then the job will not run
-
- Add repository secrets
- Go to repository settings -> Actions -> General
- Action permissions -> Allow all actions...
- Workflow permissions -> Read and write permissions
- Save
Depending on which you use you'll want to add them to readme. Using a badge like and/or as links in the docker install section and comments in docker-compose.yaml