adhocteam / pushup

Pushup is for making modern, page-oriented web apps in Go
https://pushup.adhoc.dev
MIT License
840 stars 30 forks source link

Adding a Dockerfile for quick start #58

Closed orenfromberg closed 1 year ago

orenfromberg commented 1 year ago

This branch adds a Dockerfile to potentially reduce friction with installing pushup.

A Makefile recipe is added to build the docker image locally until it is hosted on an image repository.

The README.md includes a quick start section to run the Pushup CLI. It mounts the current directory and runs the container with the same user/group to preserve file permissions. The Pushup CLI should be able to create the new scaffolding for a project, build it, and run it on localhost:8080.

Since the docker container is running go without the user having a home directory, it needs to set GOCACHE to use a hidden directory .cache in the mounted volume.

All feedback is welcome.

orenfromberg commented 1 year ago

This feels overall kind of weird to me - like putting a Dockerfile at the root of the rails repository? What similar tools include a dockerfile for running them? Do you normally run tools this way?

I tried to think of similar tools to check, and none have dockerfiles at the root: rails, express, webpack-dev-server, gopls

hugo has a Dockerfile. The main benefit of this is not needing to install golang (which I had to do to test pushup out the first time). If this doesn't seem useful, then I'm fine closing the PR.

paulsmith commented 1 year ago

It occurred to me that a practical reason to have a Dockerfile/container image is that Pushup requires Go at runtime to compile the generated project. Someone could use the Pushup container to build their site without needing to install Go explicitly.

paulsmith commented 1 year ago

@orenfromberg Can you fix up the conflicts? I'd like to merge this.