-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a Dockerfile for quick start #58
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @orenfromberg !
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.