vsergeev / briefsky

A free weather frontend to a variety of weather providers
https://briefsky.app/
Other
244 stars 24 forks source link

Add basic dockerfile to serve build with static web server #22

Closed stephen304 closed 2 months ago

stephen304 commented 3 months ago

Hi, I hope you don't mind the unsolicited PR, but I was looking at hosting my own copy of this and thought you might want the basic docker file I put together for my own use.

It's very simple and just uses a node v22 container to build the dist folder then copies that to a static-web-server container and sets up the static-web-server /health endpoint.

There's not much reason I picked static-web-server other than it being one of the first results when I searched for high performance static file servers and when I saw that it mentioned being lightweight and safe (using rust) it seemed good enough, and it's simple to swap out if you have a preference for something else.

Let me know if I can help with any changes to make this more merge-able.

Notes:

vsergeev commented 2 months ago

Thanks for the PR. So far, I've cherry-picked the relative start_url for the PWA manifest, which is preferable to a hardcoded URL.

Not opposed to introducing a Dockerfile in general, but may end up moving it to a contrib/ folder to keep the repo root directory clean.

stephen304 commented 2 months ago

No problem, I've rebased my branch to put it in contrib

vsergeev commented 2 months ago

Do the paths have to be adjusted in the Dockerfile after moving it into contrib/? I'm having a hard time building an image from outside or inside the contrib directory.

Nevermind, got it working with docker build -f contrib/Dockerfile .

I'll add a comment to the Dockerfile.

vsergeev commented 2 months ago

Cherry-picked into master.