planetary-social / rooms-frontend

MIT License
4 stars 2 forks source link

Dockerize rooms-frontend #103

Closed cooldracula closed 1 year ago

cooldracula commented 1 year ago

This PR adds a Dockerfile for serving a build rooms frontend from an nginx docker image, for easier compatibility with ansible scripts.

Importantly, the docker image does not build the vue app largely cos I was having difficulty with the memory usage the build step requires and having that happen consistently inside docker. So the best use would be to build the production distribution on a beefy machine and then run the docker build scripts after the dist folder is created.

If this flow works, I can add a PR to the wiki explaining the docker build step in more detail.

There is an example docker image of this built and available as zachboyofdestiny/rooms-frontend:1.2

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

chereseeriepa commented 1 year ago

This PR adds a Dockerfile for serving a build rooms frontend from an nginx docker image, for easier compatibility with ansible scripts.

Importantly, the docker image does not build the vue app largely cos I was having difficulty with the memory usage the build step requires and having that happen consistently inside docker. So the best use would be to build the production distribution on a beefy machine and then run the docker build scripts after the dist folder is created.

If this flow works, I can add a PR to the wiki explaining the docker build step in more detail.

There is an example docker image of this built and available as zachboyofdestiny/rooms-frontend:1.2

Awesome, I think that flow should work, so docs would be great! I think im a little unfamiliar on how it works (probably because im new to this!). So do we have to create a build like this for every room, or just one of these builds and all rooms can use a single build and apply their own envs?

cooldracula commented 1 year ago

So do we have to create a build like this for every room, or just one of these builds and >> all rooms can use a single build and apply their own envs?

Good question! It would be the latter. The builds represent the codebase at a particular commit running on particular hardware, which should be the same across hosts. So when deploying new rooms, they could all use the same build and you'd know all rooms should be behaving in the same general way.

The times when we would want to build is when some merge happens and we want all the rooms to have this updated code. In that case, we would create a new docker image for that release, tag it, and apply it to all the rooms at once.