OpenVidReview icon indicating copy to clipboard operation
OpenVidReview copied to clipboard

Improve docker, dev, and user experience

Open FoxxMD opened this issue 1 year ago • 2 comments

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.

FoxxMD avatar Jun 20 '24 14:06 FoxxMD

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.

FoxxMD avatar Jun 20 '24 14:06 FoxxMD

To use the github actions workflow to deploy automatically to dockerhub and github packages

Triggers on these actions and publishes accordingly:

  • On commit to main branch => published to dockerhub/ghcr latest tag
  • On commit to experimental branch => published to dockerhub/ghcr experimental tag
  • 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 IE davidguva/openvidreview
      • GHCR_IMAGE_NAME - the full name of the GHCR image IE ghcr.io/davidguva/openvidreview
      • If neither of the above variables are included then the job will not run
  • 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 Docker Pulls and/or as links in the docker install section and comments in docker-compose.yaml

FoxxMD avatar Jun 20 '24 15:06 FoxxMD