Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
FROM golang:1.17.6
FROM golang:1.17.6 as build
ARG COMMIT="latest"

RUN mkdir -p /heartbeat/config
ADD . /heartbeat
WORKDIR /heartbeat
RUN mkdir -p /heartbeat/config
COPY . .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this still create the heartbeat folder inside of /data as needed? Including the empty folders?

Mainly, we need the contents of /heartbeat/config inside of /heartbeat so when it is mounted, the config files reside inside of /data/heartbeat

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the data path is deliberately not created because it's intended to be a volume mount. at the time of writing, i did not know that the VOLUME instruction exists. making the config directory avoids permission issues when mounting files alone. it's not the best solution, admittedly, but hardening is probably for another PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay. I'm also unfamiliar with VOLUME, we do need to make changes to the internal server in order for it to work with the configuration that you have here? As far as I can tell?

Please let me know if I'm mistaken or if there's something I'm missing.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do remember testing this at the time, and it didn't seem to require any further modification. I'll test this again as soon as possible, but I don't think I'll have time until February. I see that there is a merge conflict so I might have failed to notice changes in the meantime.


ENV PATH "${PATH}:${GOPATH}/bin"
RUN make deps build

CMD /heartbeat/heartbeat
FROM gcr.io/distroless/base-debian11
COPY --from=build /heartbeat/heartbeat /heartbeat/heartbeat
COPY --from=build /heartbeat/www /heartbeat/www
WORKDIR /heartbeat
ENTRYPOINT [ "/heartbeat/heartbeat" ]
9 changes: 1 addition & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ build: generate

deps:
go install github.com/valyala/quicktemplate/qtc
go get -u github.com/ferluci/fast-realip
go get -u github.com/go-redis/redis/v8
go get -u github.com/joho/godotenv
go get -u github.com/nitishm/go-rejson/v4
go get -u github.com/valyala/fasthttp
go get -u github.com/valyala/quicktemplate
go get -u golang.org/x/text/language
go get -u golang.org/x/text/message
go get -u ./...
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, is there documentation on what this actually does?

I assume it just pulls everything needed as specified in the go.mod, but I'd prefer to be certain.

Copy link
Member Author

@lmaotrigine lmaotrigine Jan 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from https://go.dev/ref/mod#go-get

Upgrade modules that provide packages imported by packages in the main module.

it's just easier to do this than keep the list up to date here as well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh okay. I will resolve this specific change once I test locally to see if it does do go.mod / go.sum upgrades as expected.


docker-build:
@docker build --build-arg COMMIT=${TAG} -t ${IMG} .
Expand Down