Conversation
| RUN apk add build-base git | ||
| WORKDIR /usr/src/app | ||
| # pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change | ||
| COPY go.mod go.sum ./ |
There was a problem hiding this comment.
you can add a RUN go mod download between this and the COPY . . to download dependencies only on changes to go.mod - otherwise make will do so on every run
There was a problem hiding this comment.
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. |
|
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. |
|
@orenfromberg Can you fix up the conflicts? I'd like to merge this. |
README.md
Outdated
| ## Quick start with Docker | ||
|
|
||
| ```shell | ||
| git clone git@github.com:AdHocRandD/pushup.git |
There was a problem hiding this comment.
The git URL is stale, please use https://github.com/adhocteam/pushup.git
README.md
Outdated
| Then create a scaffolded new project in the current directory: | ||
|
|
||
| ```shell | ||
| docker run --rm -v $(pwd):/usr/src/app --user $(id -u):$(id -g) -p 8080:8080 pushup new |
There was a problem hiding this comment.
This will fail, because pushup new won't do its thing in a non-empty directory. Please change it to use an argument like myproject.
paulsmith
left a comment
There was a problem hiding this comment.
Thanks, @orenfromberg !
This branch adds a Dockerfile to potentially reduce friction with installing pushup.
A
Makefilerecipe is added to build the docker image locally until it is hosted on an image repository.The
README.mdincludes 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
.cachein the mounted volume.All feedback is welcome.